misc cleanups in Client.Common movie and watch files, mostly typos and C#7isms
This commit is contained in:
parent
e15e32eb78
commit
00691b58a2
|
@ -54,12 +54,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public static bool IsValidMovieExtension(string ext)
|
public static bool IsValidMovieExtension(string ext)
|
||||||
{
|
{
|
||||||
if (MovieExtensions.Contains(ext.ToLower().Replace(".", "")))
|
return MovieExtensions.Contains(ext.ToLower().Replace(".", ""));
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -7,7 +7,6 @@ using BizHawk.Emulation.Cores.Nintendo.NES;
|
||||||
using BizHawk.Emulation.Cores.Nintendo.SNES9X;
|
using BizHawk.Emulation.Cores.Nintendo.SNES9X;
|
||||||
using BizHawk.Emulation.Cores.Nintendo.SNES;
|
using BizHawk.Emulation.Cores.Nintendo.SNES;
|
||||||
using BizHawk.Emulation.Cores.Nintendo.GBA;
|
using BizHawk.Emulation.Cores.Nintendo.GBA;
|
||||||
using BizHawk.Emulation.Cores.Atari.A7800Hawk;
|
|
||||||
|
|
||||||
namespace BizHawk.Client.Common
|
namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
|
@ -175,13 +174,6 @@ namespace BizHawk.Client.Common
|
||||||
ModeChangedCallback();
|
ModeChangedCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Movie Refactor TODO: delete me, any code calling this is poorly designed
|
|
||||||
public bool MovieLoad()
|
|
||||||
{
|
|
||||||
MovieControllerAdapter = Movie.LogGeneratorInstance().MovieControllerAdapter;
|
|
||||||
return Movie.Load(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StopMovie(bool saveChanges = true)
|
public void StopMovie(bool saveChanges = true)
|
||||||
{
|
{
|
||||||
var message = "Movie ";
|
var message = "Movie ";
|
||||||
|
@ -276,7 +268,8 @@ namespace BizHawk.Client.Common
|
||||||
Movie.PokeFrame(Global.Emulator.Frame, Global.MovieOutputHardpoint);
|
Movie.PokeFrame(Global.Emulator.Frame, Global.MovieOutputHardpoint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Why, this was already done?
|
{
|
||||||
|
// Why, this was already done?
|
||||||
LatchInputFromLog();
|
LatchInputFromLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -291,7 +284,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
private void HandleFrameLoopForRecordMode()
|
private void HandleFrameLoopForRecordMode()
|
||||||
{
|
{
|
||||||
// we don't want tasmovie to latch user input outside its internal recording mode, so limit it to autohold
|
// we don't want TasMovie to latch user input outside its internal recording mode, so limit it to autohold
|
||||||
if (Movie is TasMovie && Movie.IsPlaying)
|
if (Movie is TasMovie && Movie.IsPlaying)
|
||||||
{
|
{
|
||||||
MovieControllerAdapter.LatchSticky();
|
MovieControllerAdapter.LatchSticky();
|
||||||
|
@ -350,13 +343,11 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string errorMsg;
|
|
||||||
|
|
||||||
//// fixme: this is evil (it causes crashes in binary states because InflaterInputStream can't have its position set, even to zero.
|
//// fixme: this is evil (it causes crashes in binary states because InflaterInputStream can't have its position set, even to zero.
|
||||||
////((StreamReader)reader).BaseStream.Position = 0;
|
////((StreamReader)reader).BaseStream.Position = 0;
|
||||||
////((StreamReader)reader).DiscardBufferedData();
|
////((StreamReader)reader).DiscardBufferedData();
|
||||||
// edit: zero 18-apr-2014 - this was solved by HackyStep1 and HackyStep2, so that the zip stream can be re-acquired instead of needing its position reset
|
// edit: zero 18-apr-2014 - this was solved by HackyStep1 and HackyStep2, so that the zip stream can be re-acquired instead of needing its position reset
|
||||||
var result = Movie.ExtractInputLog(reader, out errorMsg);
|
var result = Movie.ExtractInputLog(reader, out var errorMsg);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
Output(errorMsg);
|
Output(errorMsg);
|
||||||
|
@ -478,7 +469,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: this populates MovieControllerAdapter's Type with the approparite controller
|
// Note: this populates MovieControllerAdapter's Type with the appropriate controller
|
||||||
// Don't set it to a movie instance of the adapter or you will lose the definition!
|
// Don't set it to a movie instance of the adapter or you will lose the definition!
|
||||||
InputManager.RewireInputChain();
|
InputManager.RewireInputChain();
|
||||||
|
|
||||||
|
@ -532,7 +523,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (record) // This is a hack really, we need to set the movie to its propert state so that it will be considered active later
|
if (record) // This is a hack really, we need to set the movie to its proper state so that it will be considered active later
|
||||||
{
|
{
|
||||||
movie.SwitchToRecord();
|
movie.SwitchToRecord();
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,8 +154,7 @@ namespace BizHawk.Client.Common
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int player;
|
if (!int.TryParse(parts[0].Substring(1), out var player))
|
||||||
if (!int.TryParse(parts[0].Substring(1), out player))
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace BizHawk.Client.Common
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ToSubRip(int index, double fps, bool addcolortag)
|
public string ToSubRip(int index, double fps, bool addColorTag)
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ namespace BizHawk.Client.Common
|
||||||
// TODO: Positioning
|
// TODO: Positioning
|
||||||
|
|
||||||
// Color tag open
|
// Color tag open
|
||||||
if (addcolortag)
|
if (addColorTag)
|
||||||
{
|
{
|
||||||
uint rgb = Color & 0x00FFFFFF;
|
uint rgb = Color & 0x00FFFFFF;
|
||||||
sb.Append("<font color=\"#");
|
sb.Append("<font color=\"#");
|
||||||
|
@ -83,7 +83,7 @@ namespace BizHawk.Client.Common
|
||||||
sb.Append(Message.Trim());
|
sb.Append(Message.Trim());
|
||||||
|
|
||||||
// Color tag closeaddcolortag
|
// Color tag closeaddcolortag
|
||||||
if (addcolortag)
|
if (addColorTag)
|
||||||
{
|
{
|
||||||
sb.Append("</font>");
|
sb.Append("</font>");
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,22 +35,22 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var subparts = subtitleStr.Split(' ');
|
var subParts = subtitleStr.Split(' ');
|
||||||
|
|
||||||
// Unfortunately I made the file format space delminated so this hack is necessary to get the message
|
// Unfortunately I made the file format space delaminated so this hack is necessary to get the message
|
||||||
var message = "";
|
var message = "";
|
||||||
for (var i = 6; i < subparts.Length; i++)
|
for (var i = 6; i < subParts.Length; i++)
|
||||||
{
|
{
|
||||||
message += subparts[i] + ' ';
|
message += subParts[i] + ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
Add(new Subtitle
|
Add(new Subtitle
|
||||||
{
|
{
|
||||||
Frame = int.Parse(subparts[1]),
|
Frame = int.Parse(subParts[1]),
|
||||||
X = int.Parse(subparts[2]),
|
X = int.Parse(subParts[2]),
|
||||||
Y = int.Parse(subparts[3]),
|
Y = int.Parse(subParts[3]),
|
||||||
Duration = int.Parse(subparts[4]),
|
Duration = int.Parse(subParts[4]),
|
||||||
Color = uint.Parse(subparts[5], NumberStyles.HexNumber),
|
Color = uint.Parse(subParts[5], NumberStyles.HexNumber),
|
||||||
Message = message.Trim()
|
Message = message.Trim()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -84,12 +84,12 @@ namespace BizHawk.Client.Common
|
||||||
subs.Add(new Subtitle(subtitle));
|
subs.Add(new Subtitle(subtitle));
|
||||||
}
|
}
|
||||||
|
|
||||||
// absense of line wrap forces miltiline subtitle macros
|
// absence of line wrap forces multiline subtitle macros
|
||||||
// so we sort them just in case and optionally concat back to a single unit
|
// so we sort them just in case and optionally concat back to a single unit
|
||||||
// todo: instead of making this pretty, add the line wrap feature to subtitles
|
// todo: instead of making this pretty, add the line wrap feature to subtitles
|
||||||
if (ConcatMultilines)
|
if (ConcatMultilines)
|
||||||
{
|
{
|
||||||
int lastframe = 0;
|
int lastFrame = 0;
|
||||||
subs = subs.OrderBy(s => s.Frame).ThenBy(s => s.Y).ToList();
|
subs = subs.OrderBy(s => s.Frame).ThenBy(s => s.Y).ToList();
|
||||||
|
|
||||||
for (int i = 0;; i++)
|
for (int i = 0;; i++)
|
||||||
|
@ -101,19 +101,19 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
subs[i].Message = subs[i].Message.Trim();
|
subs[i].Message = subs[i].Message.Trim();
|
||||||
|
|
||||||
if (i > 0 && lastframe == subs[i].Frame)
|
if (i > 0 && lastFrame == subs[i].Frame)
|
||||||
{
|
{
|
||||||
subs[i].Message = $"{subs[i - 1].Message} {subs[i].Message}";
|
subs[i].Message = $"{subs[i - 1].Message} {subs[i].Message}";
|
||||||
subs.Remove(subs[i - 1]);
|
subs.Remove(subs[i - 1]);
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastframe = subs[i].Frame;
|
lastFrame = subs[i].Frame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// srt stacks musltilines upwards
|
// srt stacks multilines upwards
|
||||||
subs = subs.OrderBy(s => s.Frame).ThenByDescending(s => s.Y).ToList();
|
subs = subs.OrderBy(s => s.Frame).ThenByDescending(s => s.Y).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,11 +73,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public ControllerDefinition Definition
|
public ControllerDefinition Definition
|
||||||
{
|
{
|
||||||
get
|
get => _type;
|
||||||
{
|
|
||||||
return _type;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_type = new Bk2ControllerDefinition(value);
|
_type = new Bk2ControllerDefinition(value);
|
||||||
|
@ -203,18 +199,10 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public List<List<string>> ControlsFromLog { private get; set; } = new List<List<string>>();
|
public List<List<string>> ControlsFromLog { private get; set; } = new List<List<string>>();
|
||||||
|
|
||||||
public override IEnumerable<IEnumerable<string>> ControlsOrdered
|
public override IEnumerable<IEnumerable<string>> ControlsOrdered =>
|
||||||
{
|
ControlsFromLog.Any()
|
||||||
get
|
? ControlsFromLog
|
||||||
{
|
: base.ControlsOrdered;
|
||||||
if (ControlsFromLog.Any())
|
|
||||||
{
|
|
||||||
return ControlsFromLog;
|
|
||||||
}
|
|
||||||
|
|
||||||
return base.ControlsOrdered;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
public new string this[string key]
|
public new string this[string key]
|
||||||
{
|
{
|
||||||
get
|
get => ContainsKey(key) ? base[key] : "";
|
||||||
{
|
|
||||||
return ContainsKey(key) ? base[key] : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (ContainsKey(key))
|
if (ContainsKey(key))
|
||||||
|
|
|
@ -35,11 +35,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public string Filename
|
public string Filename
|
||||||
{
|
{
|
||||||
get
|
get => _filename;
|
||||||
{
|
|
||||||
return _filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_filename = value;
|
_filename = value;
|
||||||
|
@ -75,13 +71,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int InputLogLength
|
public int InputLogLength => Log.Count;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Log.Count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int TimeLength
|
public int TimeLength
|
||||||
{
|
{
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public IStringLog Clone()
|
public IStringLog Clone()
|
||||||
{
|
{
|
||||||
StreamStringLog ret = new StreamStringLog(_mDisk); // doesnt necessarily make sense to copy the mDisk value, they could be designated for different targets...
|
StreamStringLog ret = new StreamStringLog(_mDisk); // doesn't necessarily make sense to copy the mDisk value, they could be designated for different targets...
|
||||||
for (int i = 0; i < Count; i++)
|
for (int i = 0; i < Count; i++)
|
||||||
{
|
{
|
||||||
ret.Add(this[i]);
|
ret.Add(this[i]);
|
||||||
|
|
|
@ -330,22 +330,22 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Global.Emulator is Gameboy && (Global.Emulator as Gameboy).IsCGBMode())
|
if (Global.Emulator is Gameboy && ((Gameboy) Global.Emulator).IsCGBMode())
|
||||||
{
|
{
|
||||||
movie.HeaderEntries.Add("IsCGBMode", "1");
|
movie.HeaderEntries.Add("IsCGBMode", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Global.Emulator is SMS && (Global.Emulator as SMS).IsSG1000)
|
if (Global.Emulator is SMS && ((SMS) Global.Emulator).IsSG1000)
|
||||||
{
|
{
|
||||||
movie.HeaderEntries.Add("IsSGMode", "1");
|
movie.HeaderEntries.Add("IsSGMode", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Global.Emulator is SMS && (Global.Emulator as SMS).IsGameGear)
|
if (Global.Emulator is SMS && ((SMS) Global.Emulator).IsGameGear)
|
||||||
{
|
{
|
||||||
movie.HeaderEntries.Add("IsGGMode", "1");
|
movie.HeaderEntries.Add("IsGGMode", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Global.Emulator is GPGX && (Global.Emulator as GPGX).IsMegaCD)
|
if (Global.Emulator is GPGX && ((GPGX) Global.Emulator).IsMegaCD)
|
||||||
{
|
{
|
||||||
movie.HeaderEntries.Add("IsSegaCDMode", "1");
|
movie.HeaderEntries.Add("IsSegaCDMode", "1");
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,8 +85,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public bool? History(int frame)
|
public bool? History(int frame)
|
||||||
{
|
{
|
||||||
bool wasLag;
|
var result = _wasLag.TryGetValue(frame, out var wasLag);
|
||||||
var result = _wasLag.TryGetValue(frame, out wasLag);
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
return wasLag;
|
return wasLag;
|
||||||
|
@ -112,8 +111,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
private void RemoveLagEntry(int frame)
|
private void RemoveLagEntry(int frame)
|
||||||
{
|
{
|
||||||
bool lag;
|
var result = _lagLog.TryGetValue(frame, out var lag);
|
||||||
var result = _lagLog.TryGetValue(frame, out lag);
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
_wasLag[frame] = lag;
|
_wasLag[frame] = lag;
|
||||||
|
|
|
@ -23,11 +23,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public int MaxSteps
|
public int MaxSteps
|
||||||
{
|
{
|
||||||
get
|
get => _maxSteps;
|
||||||
{
|
|
||||||
return _maxSteps;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_maxSteps = value;
|
_maxSteps = value;
|
||||||
|
@ -346,14 +342,9 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
if (IsRecording || force)
|
if (IsRecording || force)
|
||||||
{
|
{
|
||||||
if (oldPosition == -1)
|
name = oldPosition == -1
|
||||||
{
|
? $"Set Marker at frame {newMarker.Frame}"
|
||||||
name = $"Set Marker at frame {newMarker.Frame}";
|
: $"Remove Marker at frame {oldPosition}";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
name = $"Remove Marker at frame {oldPosition}";
|
|
||||||
}
|
|
||||||
|
|
||||||
AddMovieAction(name);
|
AddMovieAction(name);
|
||||||
_history.Last().Add(new MovieActionMarker(newMarker, oldPosition, oldMessage));
|
_history.Last().Add(new MovieActionMarker(newMarker, oldPosition, oldMessage));
|
||||||
|
|
|
@ -49,9 +49,9 @@ namespace BizHawk.Client.Common
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj is TasMovieMarker)
|
if (obj is TasMovieMarker marker)
|
||||||
{
|
{
|
||||||
return Frame == ((TasMovieMarker)obj).Frame;
|
return Frame == marker.Frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -84,18 +84,10 @@ namespace BizHawk.Client.Common
|
||||||
? _states.Last().Key
|
? _states.Last().Key
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
private byte[] InitialState
|
private byte[] InitialState =>
|
||||||
{
|
_movie.StartsFromSavestate
|
||||||
get
|
? _movie.BinarySavestate
|
||||||
{
|
: _states[0];
|
||||||
if (_movie.StartsFromSavestate)
|
|
||||||
{
|
|
||||||
return _movie.BinarySavestate;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _states[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Any()
|
public bool Any()
|
||||||
{
|
{
|
||||||
|
|
|
@ -381,7 +381,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetType(DisplayType type)
|
public void SetType(DisplayType type)
|
||||||
{
|
{
|
||||||
if (_watch.IsDiplayTypeAvailable(type))
|
if (_watch.IsDiplayTypeAvailable(type))
|
||||||
{
|
{
|
||||||
_watch.Type = type;
|
_watch.Type = type;
|
||||||
|
|
|
@ -34,23 +34,13 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public int Count => _cheatList.Count;
|
public int Count => _cheatList.Count;
|
||||||
|
|
||||||
public int CheatCount
|
public int CheatCount => _cheatList.Count(c => !c.IsSeparator);
|
||||||
{
|
|
||||||
get { return _cheatList.Count(c => !c.IsSeparator); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ActiveCount
|
public int ActiveCount => _cheatList.Count(c => c.Enabled);
|
||||||
{
|
|
||||||
get { return _cheatList.Count(c => c.Enabled); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Changes
|
public bool Changes
|
||||||
{
|
{
|
||||||
get
|
get => _changes;
|
||||||
{
|
|
||||||
return _changes;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_changes = value;
|
_changes = value;
|
||||||
|
@ -67,13 +57,9 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public Cheat this[int index] => _cheatList[index];
|
public Cheat this[int index] => _cheatList[index];
|
||||||
|
|
||||||
public Cheat this[MemoryDomain domain, long address]
|
public Cheat this[MemoryDomain domain, long address] =>
|
||||||
{
|
_cheatList.FirstOrDefault(cheat => cheat.Domain == domain && cheat.Address == address);
|
||||||
get
|
|
||||||
{
|
|
||||||
return _cheatList.FirstOrDefault(cheat => cheat.Domain == domain && cheat.Address == address);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerator<Cheat> GetEnumerator()
|
public IEnumerator<Cheat> GetEnumerator()
|
||||||
{
|
{
|
||||||
|
@ -730,7 +716,7 @@ namespace BizHawk.Client.Common
|
||||||
Cheat = c;
|
Cheat = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Cheat Cheat { get; private set; }
|
public Cheat Cheat { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using BizHawk.Common.NumberExtensions;
|
|
||||||
using BizHawk.Common.StringExtensions;
|
using BizHawk.Common.StringExtensions;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using BizHawk.Common.NumberExtensions;
|
|
||||||
using BizHawk.Common.StringExtensions;
|
using BizHawk.Common.StringExtensions;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,13 @@ namespace BizHawk.Client.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static SeparatorWatch Instance => new SeparatorWatch();
|
public static SeparatorWatch Instance => new SeparatorWatch();
|
||||||
|
|
||||||
public static SeparatorWatch NewSeparatorWatch(string description)
|
public static SeparatorWatch NewSeparatorWatch(string description)
|
||||||
{
|
{
|
||||||
return new SeparatorWatch
|
return new SeparatorWatch
|
||||||
{
|
{
|
||||||
Notes = description
|
Notes = description
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the appropriate DisplayType
|
/// Get the appropriate DisplayType
|
||||||
|
@ -70,26 +70,24 @@ namespace BizHawk.Client.Common
|
||||||
/// <returns>A well formatted string representation</returns>
|
/// <returns>A well formatted string representation</returns>
|
||||||
public override string ToDisplayString()
|
public override string ToDisplayString()
|
||||||
{
|
{
|
||||||
if (Notes == null || Notes == "")
|
return string.IsNullOrEmpty(Notes)
|
||||||
return "----";
|
? "----"
|
||||||
else
|
: Notes;
|
||||||
return Notes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Transforms the current instance into a string
|
/// Transforms the current instance into a string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>A <see cref="string"/> representation of the current <see cref="Watch"/></returns>
|
/// <returns>A <see cref="string"/> representation of the current <see cref="Watch"/></returns>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return $"0\tS\t_\t1\t\t{Notes.Trim('\r', '\n')}";
|
return $"0\tS\t_\t1\t\t{Notes.Trim('\r', '\n')}";
|
||||||
//return $"{(Domain == null && Address == 0 ? "0" : Address.ToHexString((Domain?.Size ?? 0xFF - 1).NumHexDigits()))}\t{SizeAsChar}\t{TypeAsChar}\t{Convert.ToInt32(BigEndian)}\t{Domain?.Name}\t{Notes.Trim('\r', '\n')}";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ignore that stuff
|
/// Ignore that stuff
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool Poke(string value)
|
public override bool Poke(string value)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -116,8 +114,6 @@ namespace BizHawk.Client.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
//AddressString = (Notes == null || Notes == "") ? "" : Notes;
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace BizHawk.Client.Common
|
||||||
private static readonly WatchNoteComparer NoteComparer = new WatchNoteComparer();
|
private static readonly WatchNoteComparer NoteComparer = new WatchNoteComparer();
|
||||||
|
|
||||||
private readonly List<Watch> _watchList = new List<Watch>(0);
|
private readonly List<Watch> _watchList = new List<Watch>(0);
|
||||||
private readonly string _systemid;
|
private readonly string _systemId;
|
||||||
private IMemoryDomains _memoryDomains;
|
private IMemoryDomains _memoryDomains;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -52,11 +52,11 @@ namespace BizHawk.Client.Common
|
||||||
/// that will contains a set of <see cref="Watch"/>
|
/// that will contains a set of <see cref="Watch"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="core">All available memory domains</param>
|
/// <param name="core">All available memory domains</param>
|
||||||
/// <param name="systemid">System identifier (NES, SNES, ...)</param>
|
/// <param name="systemId">System identifier (NES, SNES, ...)</param>
|
||||||
public WatchList(IMemoryDomains core, string systemid)
|
public WatchList(IMemoryDomains core, string systemId)
|
||||||
{
|
{
|
||||||
_memoryDomains = core;
|
_memoryDomains = core;
|
||||||
_systemid = systemid;
|
_systemId = systemId;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -458,7 +458,7 @@ namespace BizHawk.Client.Common
|
||||||
using (var sw = new StreamWriter(CurrentFileName))
|
using (var sw = new StreamWriter(CurrentFileName))
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
sb.Append("SystemID ").AppendLine(_systemid);
|
sb.Append("SystemID ").AppendLine(_systemId);
|
||||||
|
|
||||||
foreach (var watch in _watchList)
|
foreach (var watch in _watchList)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,21 +30,18 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (string.Compare(x.Notes, y.Notes, true) == 0)
|
|
||||||
|
if (string.Compare(x.Notes, y.Notes, true) == 0)
|
||||||
{
|
{
|
||||||
if (x.Address.Equals(y.Address))
|
if (x.Address.Equals(y.Address))
|
||||||
{
|
{
|
||||||
return x.Size.CompareTo(y.Size);
|
return x.Size.CompareTo(y.Size);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return x.Address.CompareTo(y.Address);
|
||||||
return x.Address.CompareTo(y.Address);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return string.Compare(x.Notes, y.Notes, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return string.Compare(x.Notes, y.Notes, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,21 +51,18 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (xValue.Equals(yValue))
|
|
||||||
|
if (xValue.Equals(yValue))
|
||||||
{
|
{
|
||||||
if (x.Address.Equals(y.Address))
|
if (x.Address.Equals(y.Address))
|
||||||
{
|
{
|
||||||
return x.Size.CompareTo(y.Size);
|
return x.Size.CompareTo(y.Size);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return x.Address.CompareTo(y.Address);
|
||||||
return x.Address.CompareTo(y.Address);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return xValue.CompareTo(yValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return xValue.CompareTo(yValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using BizHawk.Common.NumberExtensions;
|
|
||||||
using BizHawk.Common.StringExtensions;
|
using BizHawk.Common.StringExtensions;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
|
|
|
@ -199,6 +199,7 @@
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=curr/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=curr/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=dearchive/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=dearchive/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dega/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dega/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=delaminated/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dendy/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dendy/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Disasm/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Disasm/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Disassemblable/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Disassemblable/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
@ -206,6 +207,7 @@
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dontfire/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dontfire/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ejin/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ejin/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Endian/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Endian/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=endianess/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Fairchild/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Fairchild/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Famtasia/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Famtasia/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=FCEU/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=FCEU/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
@ -226,6 +228,7 @@
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Intelli/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Intelli/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=INTV/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=INTV/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Libretro/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Libretro/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Lightgun/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Lmsv/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Lmsv/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Loadstate/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Loadstate/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Loadstates/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Loadstates/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
@ -235,6 +238,9 @@
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mainform/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mainform/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mednafen/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mednafen/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multidisk/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multidisk/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=multilines/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multitap/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multitrack/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mupen/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mupen/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nametable/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nametable/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nametables/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nametables/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
@ -247,15 +253,18 @@
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Overscan/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Overscan/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=PCFX/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=PCFX/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=PCSX/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=PCSX/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=performant/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Phaser/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Phaser/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pollable/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pollable/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Regionable/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Regionable/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=resizer/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=resizer/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Rewinder/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=samp/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=samp/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=saveram/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=saveram/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=savestate/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=savestate/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=savestates/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=savestates/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Scanline/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Scanline/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=scanlines/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Screenshot/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Screenshot/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Screensize/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Screensize/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=speccy/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=speccy/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
@ -268,7 +277,10 @@
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=taseditor/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=taseditor/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=tasproj/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=tasproj/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Tastudio/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Tastudio/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=tempfile/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=toolform/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Turboing/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Turboing/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Uninitialize/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=unmerge/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=unmerge/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=unpause/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=unpause/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=unpaused/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=unpaused/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
|
Loading…
Reference in New Issue