Spaces -> tabs.

This commit is contained in:
J.D. Purcell 2017-04-15 16:37:30 -04:00
parent ed3bf0e62b
commit b53502eed8
133 changed files with 1713 additions and 1713 deletions
BizHawk.Client.Common
BizHawk.Client.EmuHawk
BizHawk.Client.MultiHawk/Input
BizHawk.Common
BizHawk.Emulation.Common
BizHawk.Emulation.Cores

View File

@ -296,7 +296,7 @@ namespace BizHawk.Client.Common
public void GetCoreState(Action<BinaryReader, long> callbackBinary, Action<TextReader> callbackText)
{
if (!GetLump(BinaryStateLump.Corestate, false, callbackBinary)
&& !GetLump(BinaryStateLump.CorestateText, false, callbackText))
&& !GetLump(BinaryStateLump.CorestateText, false, callbackText))
{
throw new Exception("Couldn't find Binary or Text savestate");
}

View File

@ -21,7 +21,7 @@ namespace BizHawk.Client.Common
public ControllerDefinition Definition => _type;
public bool IsPressed(string button)
public bool IsPressed(string button)
{
return _buttons[button];
}

View File

@ -23,9 +23,9 @@ namespace BizHawk.Client.Common
return path;
}
/// <summary>
/// Makes a path relative to the %exe% directory
/// </summary>
/// <summary>
/// Makes a path relative to the %exe% directory
/// </summary>
public static string MakeProgramRelativePath(string path)
{
return MakeAbsolutePath("%exe%/" + path, null);

View File

@ -207,18 +207,18 @@ namespace BizHawk.Client.Common
/// </summary>
public class LoadedBMP : IVideoProvider
{
public int[] VideoBuffer { get; set; }
public int[] VideoBuffer { get; set; }
public int[] GetVideoBuffer()
{
return VideoBuffer;
}
public int[] GetVideoBuffer()
{
return VideoBuffer;
}
public int VirtualWidth => BufferWidth;
public int VirtualWidth => BufferWidth;
public int VirtualHeight => BufferHeight;
public int VirtualHeight => BufferHeight;
public int BufferWidth { get; set; }
public int BufferWidth { get; set; }
public int BufferHeight { get; set; }
public int BackgroundColor => unchecked((int)0xff000000);
}

View File

@ -33,13 +33,13 @@ namespace BizHawk.Client.Common
[JsonIgnore]
public bool Empty => !recentlist.Any();
[JsonIgnore]
[JsonIgnore]
public int Count => recentlist.Count;
[JsonIgnore]
[JsonIgnore]
public string MostRecent => recentlist.Any() ? recentlist[0] : string.Empty;
public string this[int index]
public string this[int index]
{
get
{

View File

@ -59,7 +59,7 @@ namespace BizHawk.Client.Common
private void DoMessageCallback(string message)
{
MessageCallback?.Invoke(message);
MessageCallback?.Invoke(message);
}
// TODO: reconsider the need for exposing these;
@ -636,7 +636,7 @@ namespace BizHawk.Client.Common
nextEmulator.CoreComm.RomStatusDetails = sw.ToString();
game = new GameInfo
{
Name = Path.GetFileNameWithoutExtension(file.Name),
Name = Path.GetFileNameWithoutExtension(file.Name),
System = "PSX"
};
break;

View File

@ -316,21 +316,21 @@ namespace BizHawk.Client.Common
/// </summary>
public JoypadButton AvailableButtons => _AvailableButtons;
/// <summary>
/// <summary>
/// Gets the sytem name as <see cref="string"/>
/// </summary>
public string DisplayName => _DisplayName;
/// <summary>
/// <summary>
/// Gets the maximum amount of controller allowed for this system
/// </summary>
public int MaxControllers => _MaxControllers;
/// <summary>
/// <summary>
/// Gets core used for this system as <see cref="CoreSystem"/> enum
/// </summary>
public CoreSystem System => _System;
#endregion
#endregion
}
}

View File

@ -92,7 +92,7 @@ namespace BizHawk.Client.Common
// in the case of trying to deserialize nothing, tne will be nothing
// we want to return nothing
return tne?.o;
return tne?.o;
}
}

View File

@ -126,7 +126,7 @@ namespace BizHawk.Client.Common
}
}
private static string ResolveToolsPath(string subPath)
private static string ResolveToolsPath(string subPath)
{
if (Path.IsPathRooted(subPath))
{
@ -166,7 +166,7 @@ namespace BizHawk.Client.Common
// this one is special
public string GlobalBaseFragment => Global.Config.PathEntries["Global", "Base"].Path;
public static List<PathEntry> DefaultValues => new List<PathEntry>
public static List<PathEntry> DefaultValues => new List<PathEntry>
{
new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Base", Path = ".", Ordinal = 1 },
new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "ROM", Path = ".", Ordinal = 2 },

View File

@ -6,7 +6,7 @@ namespace BizHawk.Client.Common
{
public ControllerDefinition Definition => Source.Definition;
public bool IsPressed(string button)
public bool IsPressed(string button)
{
if (Source != null && SourceAnd != null)
{
@ -31,7 +31,7 @@ namespace BizHawk.Client.Common
{
public ControllerDefinition Definition => Source.Definition;
public bool IsPressed(string button)
public bool IsPressed(string button)
{
return (Source?.IsPressed(button) ?? false)
| (SourceOr?.IsPressed(button) ?? false);

View File

@ -9,7 +9,7 @@ namespace BizHawk.Client.Common
{
public ControllerDefinition Definition => Curr.Definition;
public bool IsPressed(string button)
public bool IsPressed(string button)
{
return Curr.IsPressed(button);
}

View File

@ -19,7 +19,7 @@ namespace BizHawk.Client.Common
{
public ControllerDefinition Definition => Source.Definition;
public bool IsPressed(string button)
public bool IsPressed(string button)
{
return Source.StickyIsInEffect(button)
|| SourceStickyOr.StickyIsInEffect(button);
@ -55,7 +55,7 @@ namespace BizHawk.Client.Common
public ControllerDefinition Definition => Source.Definition;
public bool IsPressed(string button)
public bool IsPressed(string button)
{
var source = Source.IsPressed(button);
source ^= stickySet.Contains(button);
@ -282,7 +282,7 @@ namespace BizHawk.Client.Common
public HashSet<string> CurrentStickies => new HashSet<string>(_boolPatterns.Keys);
public void ClearStickies()
public void ClearStickies()
{
_boolPatterns.Clear();
_floatPatterns.Clear();

View File

@ -16,7 +16,7 @@ namespace BizHawk.Client.Common
public override string Name => "bit";
[LuaMethodAttributes(
[LuaMethodAttributes(
"band",
"Bitwise AND of 'val' against 'amt'"
)]

View File

@ -45,7 +45,7 @@ namespace BizHawk.Client.Common
public override string Name => "emu";
[LuaMethodAttributes(
[LuaMethodAttributes(
"displayvsync",
"Sets the display vsync property of the emulator"
)]

View File

@ -32,7 +32,7 @@ namespace BizHawk.Client.Common
public override string Name => "event";
#region Events Library Helpers
#region Events Library Helpers
public void CallExitEvent(Lua thread)
{

View File

@ -17,7 +17,7 @@ namespace BizHawk.Client.Common
public override string Name => "gameinfo";
[LuaMethodAttributes(
[LuaMethodAttributes(
"getromname",
"returns the path of the currently loaded rom, if a rom is loaded"
)]

View File

@ -20,7 +20,7 @@ namespace BizHawk.Client.Common
public override string Name => "genesis";
private GPGX.GPGXSettings GetSettings()
private GPGX.GPGXSettings GetSettings()
{
if (Genesis != null)
{
@ -32,7 +32,7 @@ namespace BizHawk.Client.Common
private void PutSettings(GPGX.GPGXSettings settings)
{
Genesis?.PutSettings(settings);
Genesis?.PutSettings(settings);
}
[LuaMethodAttributes(

View File

@ -13,7 +13,7 @@ namespace BizHawk.Client.Common
public override string Name => "joypad";
[LuaMethodAttributes(
[LuaMethodAttributes(
"get",
"returns a lua table of the controller buttons pressed. If supplied, it will only return a table of buttons for the given controller"
)]

View File

@ -18,7 +18,7 @@ namespace BizHawk.Client.Common
public override string Name => "mainmemory";
protected override MemoryDomain Domain
protected override MemoryDomain Domain
{
get
{

View File

@ -26,7 +26,7 @@ namespace BizHawk.Client.Common
public override string Name => "memory";
protected override MemoryDomain Domain
protected override MemoryDomain Domain
{
get
{

View File

@ -18,7 +18,7 @@ namespace BizHawk.Client.Common
public override string Name => "memorysavestate";
private readonly Dictionary<Guid, byte[]> MemorySavestates = new Dictionary<Guid, byte[]>();
private readonly Dictionary<Guid, byte[]> MemorySavestates = new Dictionary<Guid, byte[]>();
[RequiredService]
private IStatable _statableCore { get; set; }

View File

@ -15,7 +15,7 @@ namespace BizHawk.Client.Common
public override string Name => "movie";
[LuaMethodAttributes(
[LuaMethodAttributes(
"startsfromsavestate",
"Returns whether or not the movie is a savestate-anchored movie"
)]

View File

@ -31,14 +31,14 @@ namespace BizHawk.Client.Common
private bool NESAvailable => _neshawk != null || _quicknes != null;
private bool HasMemoryDOmains => _memoryDomains != null;
private bool HasMemoryDOmains => _memoryDomains != null;
public NesLuaLibrary(Lua lua, Action<string> logOutputCallback)
public NesLuaLibrary(Lua lua, Action<string> logOutputCallback)
: base(lua, logOutputCallback) { }
public override string Name => "nes";
[LuaMethodAttributes(
[LuaMethodAttributes(
"addgamegenie",
"Adds the specified game genie code. If an NES game is not currently loaded or the code is not a valid game genie code, this will have no effect"
)]

View File

@ -20,7 +20,7 @@ namespace BizHawk.Client.Common
public override string Name => "snes";
private LibsnesCore.SnesSettings GetSettings()
private LibsnesCore.SnesSettings GetSettings()
{
if (Snes != null)
{

View File

@ -11,7 +11,7 @@ namespace BizHawk.Client.Common
{
public override string Name => "bizstring";
public StringLuaLibrary(Lua lua)
public StringLuaLibrary(Lua lua)
: base(lua) { }
public StringLuaLibrary(Lua lua, Action<string> logOutputCallback)

View File

@ -21,7 +21,7 @@ namespace BizHawk.Client.EmuHawk
public override string Name => "userdata";
[LuaMethodAttributes(
[LuaMethodAttributes(
"set",
"adds or updates the data with the given key with the given value"
)]

View File

@ -182,11 +182,11 @@ __Types and notation__
public MethodInfo Method => _method;
public string Name => _luaAttributes.Name;
public string Name => _luaAttributes.Name;
public string Description => _luaAttributes.Description;
public string Description => _luaAttributes.Description;
private string _paramterList = null;
private string _paramterList = null;
public string ParameterList
{

View File

@ -46,7 +46,7 @@
public static LuaFile SeparatorInstance => new LuaFile(true);
public void Stop()
public void Stop()
{
State = RunState.Disabled;
Thread = null;

View File

@ -117,9 +117,9 @@ namespace BizHawk.Client.Common
ForEach(lua => Global.Config.RecentLua.Add(lua.Path));
_filename = path;
LoadCallback?.Invoke();
LoadCallback?.Invoke();
return true;
return true;
}
return false;

View File

@ -92,7 +92,7 @@ namespace BizHawk.Client.Common
{
Console.WriteLine(ex);
Logger(ex.ToString());
exceptionCallback?.Invoke();
exceptionCallback?.Invoke();
}
finally
{

View File

@ -7,7 +7,7 @@ namespace BizHawk.Client.Common
{
private readonly LuaFunction _function;
public NamedLuaFunction(LuaFunction function, string theevent, Action<string> logCallback, Lua lua, string name = null)
public NamedLuaFunction(LuaFunction function, string theevent, Action<string> logCallback, Lua lua, string name = null)
{
_function = function;
Name = name ?? "Anonymous";
@ -36,13 +36,13 @@ namespace BizHawk.Client.Common
public string Name { get; }
public Lua Lua { get; }
public Lua Lua { get; }
public string Event { get; }
public Action Callback { get; }
public Action Callback { get; }
public void Call(string name = null)
public void Call(string name = null)
{
LuaSandbox.Sandbox(Lua, () =>
{

View File

@ -95,9 +95,9 @@ namespace BizHawk.Client.Common
public ControllerDefinition Definition => Source.Definition;
public bool this[string button] => IsPressed(button);
public bool this[string button] => IsPressed(button);
public bool IsPressed(string button)
public bool IsPressed(string button)
{
return Source.IsPressed(RemapButtonName(button));
}

View File

@ -104,6 +104,6 @@ namespace BizHawk.Client.Common
sb.Append("\r\n");
return sb.ToString();
}
}
}
}

View File

@ -74,9 +74,9 @@ namespace BizHawk.Client.Common
});
}
public string ToSubRip(double fps)
{
int index = 1;
public string ToSubRip(double fps)
{
int index = 1;
var sb = new StringBuilder();
List<Subtitle> subs = new List<Subtitle>();
foreach (var subtitle in this)
@ -116,7 +116,7 @@ namespace BizHawk.Client.Common
foreach (var subtitle in subs)
sb.Append(subtitle.ToSubRip(index++, fps, AddColorTag));
return sb.ToString();
}
return sb.ToString();
}
}
}

View File

@ -21,7 +21,7 @@ namespace BizHawk.Client.Common
public IMovieController MovieControllerAdapter => new Bk2ControllerAdapter(_logKey);
#region ILogEntryGenerator Implementation
#region ILogEntryGenerator Implementation
public void SetSource(IController source)
{
@ -35,9 +35,9 @@ namespace BizHawk.Client.Common
public bool IsEmpty => EmptyEntry == GenerateLogEntry();
public string EmptyEntry => CreateLogEntry(createEmpty: true);
public string EmptyEntry => CreateLogEntry(createEmpty: true);
public string GenerateLogEntry()
public string GenerateLogEntry()
{
return CreateLogEntry();
}

View File

@ -9,13 +9,13 @@ namespace BizHawk.Client.Common
public bool IsActive => _mode != Moviemode.Inactive;
public bool IsPlaying => _mode == Moviemode.Play || _mode == Moviemode.Finished;
public bool IsPlaying => _mode == Moviemode.Play || _mode == Moviemode.Finished;
public bool IsRecording => _mode == Moviemode.Record;
public bool IsRecording => _mode == Moviemode.Record;
public bool IsFinished => _mode == Moviemode.Finished;
public bool IsFinished => _mode == Moviemode.Finished;
public virtual void StartNewRecording()
public virtual void StartNewRecording()
{
_mode = Moviemode.Record;
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Any())

View File

@ -48,7 +48,7 @@ namespace BizHawk.Client.Common
public virtual string PreferredExtension => Extension;
public const string Extension = "bk2";
public const string Extension = "bk2";
public virtual bool Changes { get; protected set; }
public bool IsCountingRerecords { get; set; }
@ -73,7 +73,7 @@ namespace BizHawk.Client.Common
public int InputLogLength => _log.Count;
#region Log Editing
#region Log Editing
public void AppendFrame(IController source)
{

View File

@ -104,7 +104,7 @@ namespace BizHawk.Client.Common
public int Count => Offsets.Count;
public void Clear()
public void Clear()
{
stream.SetLength(0);
Offsets.Clear();

View File

@ -279,7 +279,7 @@ namespace BizHawk.Client.Common
private string ControlType => Definition.Name;
private void SetGBAControllersAsMnemonic(string mnemonic)
private void SetGBAControllersAsMnemonic(string mnemonic)
{
MnemonicChecker c = new MnemonicChecker(mnemonic);
MyBoolButtons.Clear();

View File

@ -205,7 +205,7 @@ namespace BizHawk.Client.Common
public bool IsEmpty => EmptyEntry == GenerateLogEntry();
public string EmptyEntry
public string EmptyEntry
{
get
{
@ -256,7 +256,7 @@ namespace BizHawk.Client.Common
public IMovieController MovieControllerAdapter => new BkmControllerAdapter();
#region Privates
#region Privates
private bool IsBasePressed(string name)
{

View File

@ -80,7 +80,7 @@ namespace BizHawk.Client.Common
{"0", "0"}, {"1", "1"}, {"2", "2"}, {"3", "3"}, {"4", "4"}, {"5", "5"}, {"6", "6"}, {"7", "7"},
{"8", "8"}, {"9", "9"}, {"DOT", "`"}, {"ON", "O"}, {"ENTER", "="}, {"UP", "U"}, {"DOWN", "D"},
{"LEFT", "L"}, {"RIGHT", "R"}, {"PLUS", "+"}, {"MINUS", "_"}, {"MULTIPLY", "*"}, {"DIVIDE", "/"},
{"CLEAR", "c"}, {"EXP", "^"}, {"DASH", "-"}, {"PARAOPEN", "("}, {"PARACLOSE", ")"}, {"TAN", "T"},
{"CLEAR", "c"}, {"EXP", "^"}, {"DASH", "-"}, {"PARAOPEN", "("}, {"PARACLOSE", ")"}, {"TAN", "T"},
{"VARS", "V"}, {"COS", "C"}, {"PRGM", "P"}, {"STAT", "s"}, {"MATRIX", "m"}, {"X", "X"}, {"STO", ">"},
{"LN", "n"}, {"LOG", "L"}, {"SQUARED", "2"}, {"NEG1", "1"}, {"MATH", "H"}, {"ALPHA", "A"},
{"GRAPH", "G"}, {"TRACE", "t"}, {"ZOOM", "Z"}, {"WINDOW", "W"}, {"Y", "Y"}, {"2ND", "&"}, {"MODE", "O"},

View File

@ -6,11 +6,11 @@ namespace BizHawk.Client.Common
{
public IDictionary<string, string> HeaderEntries => Header;
public SubtitleList Subtitles => Header.Subtitles;
public SubtitleList Subtitles => Header.Subtitles;
public IList<string> Comments => Header.Comments;
public IList<string> Comments => Header.Comments;
public string SyncSettingsJson
public string SyncSettingsJson
{
get { return Header[HeaderKeys.SYNCSETTINGS]; }
set { Header[HeaderKeys.SYNCSETTINGS] = value; }

View File

@ -10,13 +10,13 @@ namespace BizHawk.Client.Common
public bool IsPlaying => _mode == Moviemode.Play || _mode == Moviemode.Finished;
public bool IsRecording => _mode == Moviemode.Record;
public bool IsRecording => _mode == Moviemode.Record;
public bool IsActive => _mode != Moviemode.Inactive;
public bool IsActive => _mode != Moviemode.Inactive;
public bool IsFinished => _mode == Moviemode.Finished;
public bool IsFinished => _mode == Moviemode.Finished;
public void StartNewRecording()
public void StartNewRecording()
{
_mode = Moviemode.Record;
if (Global.Config.EnableBackupMovies && _makeBackup && _log.Any())

View File

@ -36,7 +36,7 @@ namespace BizHawk.Client.Common
public string PreferredExtension => Extension;
public const string Extension = "bkm";
public const string Extension = "bkm";
public BkmHeader Header { get; }
public string Filename { get; set; }
@ -45,7 +45,7 @@ namespace BizHawk.Client.Common
public int InputLogLength => _log.Count;
public double FrameCount
public double FrameCount
{
get
{

View File

@ -344,10 +344,10 @@ namespace BizHawk.Client.Common
Global.MovieSession.MovieControllerAdapter.LatchSticky();
var lg = LogGeneratorInstance();
lg.SetSource(Global.MovieOutputHardpoint); // account for autohold. needs autohold pattern to be already recorded in the current frame
lg.SetSource(Global.MovieOutputHardpoint); // account for autohold. needs autohold pattern to be already recorded in the current frame
for (int i = 0; i < numFrames; i++)
_log.Add(lg.GenerateLogEntry());
_log.Add(lg.GenerateLogEntry());
Changes = true;

View File

@ -149,7 +149,7 @@ namespace BizHawk.Client.Common
StateManager.Invalidate(frame + 1);
Changes = true; // TODO check if this actually removed anything before flagging changes
if (anyInvalidated && Global.MovieSession.Movie.IsCountingRerecords)
if (anyInvalidated && Global.MovieSession.Movie.IsCountingRerecords)
{
base.Rerecords++;
}

View File

@ -63,33 +63,33 @@ namespace BizHawk.Client.Common
public static Cheat Separator => new Cheat(SeparatorWatch.Instance, 0, null, false);
public bool IsSeparator => _watch.IsSeparator;
public bool IsSeparator => _watch.IsSeparator;
public bool Enabled => !IsSeparator && _enabled;
public bool Enabled => !IsSeparator && _enabled;
public long? Address => _watch.Address;
public long? Address => _watch.Address;
public int? Value => IsSeparator ? (int?)null : _val;
public int? Value => IsSeparator ? (int?)null : _val;
public bool? BigEndian => IsSeparator ? (bool?)null : _watch.BigEndian;
public bool? BigEndian => IsSeparator ? (bool?)null : _watch.BigEndian;
public int? Compare => _compare.HasValue && !IsSeparator ? _compare : null;
public int? Compare => _compare.HasValue && !IsSeparator ? _compare : null;
public MemoryDomain Domain => _watch.Domain;
public MemoryDomain Domain => _watch.Domain;
public WatchSize Size => _watch.Size;
public WatchSize Size => _watch.Size;
public char SizeAsChar => _watch.SizeAsChar;
public char SizeAsChar => _watch.SizeAsChar;
public DisplayType Type => _watch.Type;
public DisplayType Type => _watch.Type;
public char TypeAsChar => _watch.TypeAsChar;
public char TypeAsChar => _watch.TypeAsChar;
public string Name => IsSeparator ? string.Empty : _watch.Notes;
public string Name => IsSeparator ? string.Empty : _watch.Notes;
public string AddressStr => _watch.AddressString;
public string AddressStr => _watch.AddressString;
public string ValueStr
public string ValueStr
{
get
{
@ -134,7 +134,7 @@ namespace BizHawk.Client.Common
public COMPARISONTYPE ComparisonType => _comparisonType;
public void Enable(bool handleChange = true)
public void Enable(bool handleChange = true)
{
if (!IsSeparator)
{
@ -354,7 +354,7 @@ namespace BizHawk.Client.Common
private void Changes()
{
Changed?.Invoke(this);
Changed?.Invoke(this);
}
public override bool Equals(object obj)

View File

@ -23,7 +23,7 @@ namespace BizHawk.Client.Common
public int Count => _cheatList.Count;
public int CheatCount
public int CheatCount
{
get { return _cheatList.Count(x => !x.IsSeparator); }
}
@ -52,11 +52,11 @@ namespace BizHawk.Client.Common
public string CurrentFileName => _currentFileName;
public bool IsReadOnly => false;
public bool IsReadOnly => false;
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]
{
get
{

View File

@ -510,9 +510,9 @@ namespace BizHawk.Client.Common
public bool CanUndo => _keepHistory && _history.CanUndo;
public bool CanRedo => _keepHistory && _history.CanRedo;
public bool CanRedo => _keepHistory && _history.CanRedo;
public void ClearHistory()
public void ClearHistory()
{
_history.Clear();
}
@ -945,7 +945,7 @@ namespace BizHawk.Client.Common
public long Previous => _previous;
public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian)
public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian)
{
_previous = domain.PeekByte(Address % domain.Size);
}
@ -986,7 +986,7 @@ namespace BizHawk.Client.Common
public long Previous => _previous;
public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian)
public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian)
{
_previous = domain.PeekUint(Address, bigendian);
}
@ -1013,9 +1013,9 @@ namespace BizHawk.Client.Common
public long Previous => _previous;
public int ChangeCount => _changecount;
public int ChangeCount => _changecount;
public void Update(PreviousType type, MemoryDomain domain, bool bigendian)
public void Update(PreviousType type, MemoryDomain domain, bool bigendian)
{
var value = domain.PeekByte(Address % domain.Size);
@ -1068,9 +1068,9 @@ namespace BizHawk.Client.Common
public long Previous => _previous;
public int ChangeCount => _changecount;
public int ChangeCount => _changecount;
public void Update(PreviousType type, MemoryDomain domain, bool bigendian)
public void Update(PreviousType type, MemoryDomain domain, bool bigendian)
{
var value = domain.PeekUshort(Address % domain.Size, bigendian);
if (value != Previous)

View File

@ -252,29 +252,29 @@ namespace BizHawk.Client.Common
/// </summary>
public override uint MaxValue => byte.MaxValue;
/// <summary>
/// <summary>
/// Get the current value
/// </summary>
public override int Value => GetByte();
/// <summary>
/// <summary>
/// Gets the current value
/// but with stuff I don't understand
/// </summary>
/// <remarks>zero 15-nov-2015 - bypass LIAR LOGIC, see fdc9ea2aa922876d20ba897fb76909bf75fa6c92 https://github.com/TASVideos/BizHawk/issues/326 </remarks>
public override int ValueNoFreeze => GetByte(true);
/// <summary>
/// <summary>
/// Get a string representation of the current value
/// </summary>
public override string ValueString => FormatValue(GetByte());
/// <summary>
/// <summary>
/// Get the previous value
/// </summary>
public override int Previous => _previous;
/// <summary>
/// <summary>
/// Get a string representation of the previous value
/// </summary>
public override string PreviousStr => FormatValue(_previous);

View File

@ -262,38 +262,38 @@ namespace BizHawk.Client.Common
/// </summary>
public override string Diff => FormatValue(_previous - _value);
/// <summary>
/// <summary>
/// Get the maximum possible value
/// </summary>
public override uint MaxValue => uint.MaxValue;
/// <summary>
/// <summary>
/// Get the current value
/// </summary>
public override int Value => (int)GetDWord();
/// <summary>
/// <summary>
/// Gets the current value
/// but with stuff I don't understand
/// </summary>
public override int ValueNoFreeze => (int)GetDWord(true);
/// <summary>
/// <summary>
/// Get a string representation of the current value
/// </summary>
public override string ValueString => FormatValue(GetDWord());
/// <summary>
/// <summary>
/// Get the previous value
/// </summary>
public override int Previous => (int)_previous;
/// <summary>
/// <summary>
/// Get a string representation of the previous value
/// </summary>
public override string PreviousStr => FormatValue(_previous);
#endregion Implements
#endregion Implements
#endregion
}

View File

@ -160,8 +160,8 @@ namespace BizHawk.Client.EmuHawk
0,0,0,0,0,0,0,0,0,0,
0,0,0,0};
private void AboutBox_Load(object sender, EventArgs e)
{
private void AboutBox_Load(object sender, EventArgs e)
{
#if DEBUG
Text = "BizHawk Developer Build (DEBUG MODE) GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH;
#else

View File

@ -1071,7 +1071,7 @@ namespace BizHawk.Client.EmuHawk
{
if (ModifierKeys == Keys.Alt)
{
// do marker drag here
// do marker drag here
}
else if (ModifierKeys == Keys.Shift)
{

View File

@ -125,14 +125,14 @@ namespace BizHawk.Client.EmuHawk
// ********************************** Instance Members **********************************
readonly Controller controller;
uint index0;
uint index0;
XINPUT_STATE state;
public int PlayerNumber { get { return (int)index0 + 1; } }
public int PlayerNumber { get { return (int)index0 + 1; } }
GamePad360(uint index0, Controller c)
{
this.index0 = index0;
this.index0 = index0;
controller = c;
InitializeButtons();
Update();

View File

@ -5,105 +5,105 @@ using System.Text;
namespace BizHawk.Client.EmuHawk
{
//Data structure for a watch item in the RAM Watch Dialog
public enum atype { BYTE, WORD, DWORD, SEPARATOR }; //TODO: more custom types too like 12.4 and 24.12 fixed point
public enum asigned { SIGNED, UNSIGNED, HEX };
public class Watch
{
public Watch()
{
address = 0;
value = 0;
type = atype.BYTE;
signed = asigned.UNSIGNED;
bigendian = true;
notes = "";
}
public Watch(int Address, int Value, atype Type, asigned Signed, bool BigEndian, string Notes)
{
address = Address;
value = Value;
type = Type;
signed = Signed;
bigendian = BigEndian;
notes = Notes;
}
public int address { get; set; }
public int value { get; set; } //Current value
public atype type { get; set; } //Address type (byte, word, dword, etc
public asigned signed { get; set; } //Signed/Unsigned?
public bool bigendian { get; set; }
public string notes { get; set; } //User notes
//Data structure for a watch item in the RAM Watch Dialog
public enum atype { BYTE, WORD, DWORD, SEPARATOR }; //TODO: more custom types too like 12.4 and 24.12 fixed point
public enum asigned { SIGNED, UNSIGNED, HEX };
public class Watch
{
public Watch()
{
address = 0;
value = 0;
type = atype.BYTE;
signed = asigned.UNSIGNED;
bigendian = true;
notes = "";
}
public Watch(int Address, int Value, atype Type, asigned Signed, bool BigEndian, string Notes)
{
address = Address;
value = Value;
type = Type;
signed = Signed;
bigendian = BigEndian;
notes = Notes;
}
public int address { get; set; }
public int value { get; set; } //Current value
public atype type { get; set; } //Address type (byte, word, dword, etc
public asigned signed { get; set; } //Signed/Unsigned?
public bool bigendian { get; set; }
public string notes { get; set; } //User notes
public bool SetTypeByChar(char c) //b = byte, w = word, d = dword
{
switch (c)
{
case 'b':
type = atype.BYTE;
return true;
case 'w':
type = atype.WORD;
return true;
case 'd':
type = atype.DWORD;
return true;
case 'S':
type = atype.SEPARATOR;
return true;
default:
return false;
}
}
public bool SetTypeByChar(char c) //b = byte, w = word, d = dword
{
switch (c)
{
case 'b':
type = atype.BYTE;
return true;
case 'w':
type = atype.WORD;
return true;
case 'd':
type = atype.DWORD;
return true;
case 'S':
type = atype.SEPARATOR;
return true;
default:
return false;
}
}
public char GetTypeByChar()
{
switch (type)
{
case atype.BYTE:
return 'b';
case atype.WORD:
return 'w';
case atype.DWORD:
return 'd';
case atype.SEPARATOR:
return 'S';
default:
return 'b'; //Just in case
}
}
public char GetTypeByChar()
{
switch (type)
{
case atype.BYTE:
return 'b';
case atype.WORD:
return 'w';
case atype.DWORD:
return 'd';
case atype.SEPARATOR:
return 'S';
default:
return 'b'; //Just in case
}
}
public bool SetSignedByChar(char c) //s = signed, u = unsigned, h = hex
{
switch (c)
{
case 's':
signed = asigned.SIGNED;
return true;
case 'u':
signed = asigned.UNSIGNED;
return true;
case 'h':
signed = asigned.HEX;
return true;
default:
return false;
}
}
public bool SetSignedByChar(char c) //s = signed, u = unsigned, h = hex
{
switch (c)
{
case 's':
signed = asigned.SIGNED;
return true;
case 'u':
signed = asigned.UNSIGNED;
return true;
case 'h':
signed = asigned.HEX;
return true;
default:
return false;
}
}
public char GetSignedByChar()
{
switch (signed)
{
case asigned.SIGNED:
return 's';
case asigned.UNSIGNED:
return 'u';
case asigned.HEX:
return 'h';
default:
return 's'; //Just in case
}
}
}
public char GetSignedByChar()
{
switch (signed)
{
case asigned.SIGNED:
return 's';
case asigned.UNSIGNED:
return 'u';
case asigned.HEX:
return 'h';
default:
return 's'; //Just in case
}
}
}
}

View File

@ -423,34 +423,34 @@ namespace BizHawk.Client.EmuHawk
{
Global.Config.DispFPSx = Config.DefaultMessageOptions.DispFPSx;
Global.Config.DispFPSy = Config.DefaultMessageOptions.DispFPSy;
Global.Config.DispFrameCx = Config.DefaultMessageOptions.DispFrameCx;
Global.Config.DispFrameCy = Config.DefaultMessageOptions.DispFrameCy;
Global.Config.DispLagx = Config.DefaultMessageOptions.DispLagx;
Global.Config.DispLagy = Config.DefaultMessageOptions.DispLagy;
Global.Config.DispInpx = Config.DefaultMessageOptions.DispInpx;
Global.Config.DispInpy = Config.DefaultMessageOptions.DispInpy;
Global.Config.DispRecx = Config.DefaultMessageOptions.DispRecx;
Global.Config.DispRecy = Config.DefaultMessageOptions.DispRecy;
Global.Config.DispMultix = Config.DefaultMessageOptions.DispMultix;
Global.Config.DispMultiy = Config.DefaultMessageOptions.DispMultiy;
Global.Config.DispMessagex = Config.DefaultMessageOptions.DispMessagex;
Global.Config.DispMessagey = Config.DefaultMessageOptions.DispMessagey;
Global.Config.DispAutoholdx = Config.DefaultMessageOptions.DispAutoholdx;
Global.Config.DispAutoholdy = Config.DefaultMessageOptions.DispAutoholdy;
Global.Config.DispFrameCx = Config.DefaultMessageOptions.DispFrameCx;
Global.Config.DispFrameCy = Config.DefaultMessageOptions.DispFrameCy;
Global.Config.DispLagx = Config.DefaultMessageOptions.DispLagx;
Global.Config.DispLagy = Config.DefaultMessageOptions.DispLagy;
Global.Config.DispInpx = Config.DefaultMessageOptions.DispInpx;
Global.Config.DispInpy = Config.DefaultMessageOptions.DispInpy;
Global.Config.DispRecx = Config.DefaultMessageOptions.DispRecx;
Global.Config.DispRecy = Config.DefaultMessageOptions.DispRecy;
Global.Config.DispMultix = Config.DefaultMessageOptions.DispMultix;
Global.Config.DispMultiy = Config.DefaultMessageOptions.DispMultiy;
Global.Config.DispMessagex = Config.DefaultMessageOptions.DispMessagex;
Global.Config.DispMessagey = Config.DefaultMessageOptions.DispMessagey;
Global.Config.DispAutoholdx = Config.DefaultMessageOptions.DispAutoholdx;
Global.Config.DispAutoholdy = Config.DefaultMessageOptions.DispAutoholdy;
Global.Config.DispFPSanchor = Config.DefaultMessageOptions.DispFPSanchor;
Global.Config.DispFrameanchor = Config.DefaultMessageOptions.DispFrameanchor;
Global.Config.DispLaganchor = Config.DefaultMessageOptions.DispLaganchor;
Global.Config.DispInpanchor = Config.DefaultMessageOptions.DispInpanchor;
Global.Config.DispRecanchor = Config.DefaultMessageOptions.DispRecanchor;
Global.Config.DispMultianchor = Config.DefaultMessageOptions.DispMultianchor;
Global.Config.DispMessageanchor = Config.DefaultMessageOptions.DispMessageanchor;
Global.Config.DispAutoholdanchor = Config.DefaultMessageOptions.DispAutoholdanchor;
Global.Config.DispFPSanchor = Config.DefaultMessageOptions.DispFPSanchor;
Global.Config.DispFrameanchor = Config.DefaultMessageOptions.DispFrameanchor;
Global.Config.DispLaganchor = Config.DefaultMessageOptions.DispLaganchor;
Global.Config.DispInpanchor = Config.DefaultMessageOptions.DispInpanchor;
Global.Config.DispRecanchor = Config.DefaultMessageOptions.DispRecanchor;
Global.Config.DispMultianchor = Config.DefaultMessageOptions.DispMultianchor;
Global.Config.DispMessageanchor = Config.DefaultMessageOptions.DispMessageanchor;
Global.Config.DispAutoholdanchor = Config.DefaultMessageOptions.DispAutoholdanchor;
Global.Config.MessagesColor = Config.DefaultMessageOptions.MessagesColor;
Global.Config.AlertMessageColor = Config.DefaultMessageOptions.AlertMessageColor;
Global.Config.LastInputColor = Config.DefaultMessageOptions.LastInputColor;
Global.Config.MovieInput = Config.DefaultMessageOptions.MovieInput;
Global.Config.MessagesColor = Config.DefaultMessageOptions.MessagesColor;
Global.Config.AlertMessageColor = Config.DefaultMessageOptions.AlertMessageColor;
Global.Config.LastInputColor = Config.DefaultMessageOptions.LastInputColor;
Global.Config.MovieInput = Config.DefaultMessageOptions.MovieInput;
_dispFpSx = Global.Config.DispFPSx;
_dispFpSy = Global.Config.DispFPSy;
@ -476,17 +476,17 @@ namespace BizHawk.Client.EmuHawk
_dispRecanchor = Global.Config.DispRecanchor;
_dispMultiAnchor = Global.Config.DispMultianchor;
_dispMessageAnchor = Global.Config.DispMessageanchor;
_dispAutoholdAnchor = Global.Config.DispAutoholdanchor;
_dispAutoholdAnchor = Global.Config.DispAutoholdanchor;
_messageColor = Global.Config.MessagesColor;
_alertColor = Global.Config.AlertMessageColor;
_lastInputColor = Global.Config.LastInputColor;
_movieInput = Global.Config.MovieInput;
_messageColor = Global.Config.MessagesColor;
_alertColor = Global.Config.AlertMessageColor;
_lastInputColor = Global.Config.LastInputColor;
_movieInput = Global.Config.MovieInput;
MessageColorDialog.Color = Color.FromArgb(_messageColor);
AlertColorDialog.Color = Color.FromArgb(_alertColor);
LInputColorDialog.Color = Color.FromArgb(_lastInputColor);
MovieInputColorDialog.Color = Color.FromArgb(_movieInput);
MessageColorDialog.Color = Color.FromArgb(_messageColor);
AlertColorDialog.Color = Color.FromArgb(_alertColor);
LInputColorDialog.Color = Color.FromArgb(_lastInputColor);
MovieInputColorDialog.Color = Color.FromArgb(_movieInput);
SetMaxXY();
SetColorBox();

View File

@ -64,7 +64,7 @@ namespace BizHawk.Client.EmuHawk
private void Cancel_Click(object sender, EventArgs e)
{
// restore previous value
_nes.PutSettings(_oldSettings);
_nes.PutSettings(_oldSettings);
Close();
}
@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk
{
label6.Text = trackBar1.Value.ToString();
_settings.Square1 = trackBar1.Value;
_nes.PutSettings(_settings);
_nes.PutSettings(_settings);
}
private void trackBar2_ValueChanged(object sender, EventArgs e)

View File

@ -169,54 +169,54 @@ namespace BizHawk.Client.EmuHawk
}
}
private void Export_Click(object sender, EventArgs e)
{
// Get file to save as
var form = new SaveFileDialog();
form.AddExtension = true;
form.Filter = "SubRip Files (*.srt)|*.srt|All files (*.*)|*.*";
private void Export_Click(object sender, EventArgs e)
{
// Get file to save as
var form = new SaveFileDialog();
form.AddExtension = true;
form.Filter = "SubRip Files (*.srt)|*.srt|All files (*.*)|*.*";
var result = form.ShowDialog();
var fileName = form.FileName;
var result = form.ShowDialog();
var fileName = form.FileName;
form.Dispose();
form.Dispose();
if (result != System.Windows.Forms.DialogResult.OK)
return;
if (result != System.Windows.Forms.DialogResult.OK)
return;
// Fetch fps
var system = _selectedMovie.HeaderEntries[HeaderKeys.PLATFORM];
var pal = _selectedMovie.HeaderEntries.ContainsKey(HeaderKeys.PAL)
&& _selectedMovie.HeaderEntries[HeaderKeys.PAL] == "1";
var pfr = new PlatformFrameRates();
double fps = 1;
// Fetch fps
var system = _selectedMovie.HeaderEntries[HeaderKeys.PLATFORM];
var pal = _selectedMovie.HeaderEntries.ContainsKey(HeaderKeys.PAL)
&& _selectedMovie.HeaderEntries[HeaderKeys.PAL] == "1";
var pfr = new PlatformFrameRates();
double fps = 1;
try
{
fps = pfr[system, pal];
}
catch
{
MessageBox.Show(
"Could not determine movie fps, export failed.",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error
);
try
{
fps = pfr[system, pal];
}
catch
{
MessageBox.Show(
"Could not determine movie fps, export failed.",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error
);
return;
}
return;
}
// Create string and write to file
var str = _selectedMovie.Subtitles.ToSubRip(fps);
File.WriteAllText(fileName, str);
// Create string and write to file
var str = _selectedMovie.Subtitles.ToSubRip(fps);
File.WriteAllText(fileName, str);
// Display success
MessageBox.Show(
string.Format("Subtitles succesfully exported to {0}.", fileName),
"Success"
);
}
// Display success
MessageBox.Show(
string.Format("Subtitles succesfully exported to {0}.", fileName),
"Success"
);
}
private void SubGrid_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
{

View File

@ -96,7 +96,7 @@ namespace BizHawk.Client.EmuHawk
Settings = new BasicBotSettings();
_comparisonBotAttempt = new BotAttempt();
}
}
private void BasicBot_Load(object sender, EventArgs e)
{
@ -287,59 +287,59 @@ namespace BizHawk.Client.EmuHawk
}
}
public byte MainComparisonType
{
get
{
return (byte)MainOperator.SelectedIndex;
}
set
{
if (value < 5) MainOperator.SelectedIndex = value;
else MainOperator.SelectedIndex = 0;
}
}
public byte MainComparisonType
{
get
{
return (byte)MainOperator.SelectedIndex;
}
set
{
if (value < 5) MainOperator.SelectedIndex = value;
else MainOperator.SelectedIndex = 0;
}
}
public byte Tie1ComparisonType
{
get
{
return (byte)Tiebreak1Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak1Operator.SelectedIndex = value;
else Tiebreak1Operator.SelectedIndex = 0;
}
}
public byte Tie1ComparisonType
{
get
{
return (byte)Tiebreak1Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak1Operator.SelectedIndex = value;
else Tiebreak1Operator.SelectedIndex = 0;
}
}
public byte Tie2ComparisonType
{
get
{
return (byte)Tiebreak2Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak2Operator.SelectedIndex = value;
else Tiebreak2Operator.SelectedIndex = 0;
}
}
public byte Tie2ComparisonType
{
get
{
return (byte)Tiebreak2Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak2Operator.SelectedIndex = value;
else Tiebreak2Operator.SelectedIndex = 0;
}
}
public byte Tie3ComparisonType
{
get
{
return (byte)Tiebreak3Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak3Operator.SelectedIndex = value;
else Tiebreak3Operator.SelectedIndex = 0;
}
}
public byte Tie3ComparisonType
{
get
{
return (byte)Tiebreak3Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak3Operator.SelectedIndex = value;
else Tiebreak3Operator.SelectedIndex = 0;
}
}
public string FromSlot
public string FromSlot
{
get
{
@ -449,10 +449,10 @@ namespace BizHawk.Client.EmuHawk
TieBreaker2Address = 0;
TieBreaker3Address = 0;
StartFromSlotBox.SelectedIndex = 0;
MainOperator.SelectedIndex = 0;
Tiebreak1Operator.SelectedIndex = 0;
Tiebreak2Operator.SelectedIndex = 0;
Tiebreak3Operator.SelectedIndex = 0;
MainOperator.SelectedIndex = 0;
Tiebreak1Operator.SelectedIndex = 0;
Tiebreak2Operator.SelectedIndex = 0;
Tiebreak3Operator.SelectedIndex = 0;
MainBestRadio.Checked = true;
MainValueNumeric.Value = 0;
TieBreak1Numeric.Value = 0;
@ -622,10 +622,10 @@ namespace BizHawk.Client.EmuHawk
public int TieBreak1 { get; set; }
public int TieBreak2 { get; set; }
public int TieBreak3 { get; set; }
public byte ComparisonTypeMain { get; set; }
public byte ComparisonTypeTie1 { get; set; }
public byte ComparisonTypeTie2 { get; set; }
public byte ComparisonTypeTie3 { get; set; }
public byte ComparisonTypeMain { get; set; }
public byte ComparisonTypeTie1 { get; set; }
public byte ComparisonTypeTie2 { get; set; }
public byte ComparisonTypeTie3 { get; set; }
public List<string> Log { get; set; }
}
@ -981,23 +981,23 @@ namespace BizHawk.Client.EmuHawk
return true;
}
private bool TestValue(byte operation, int currentValue, int bestValue)
{
switch (operation)
{
case 0:
return currentValue > bestValue;
case 1:
return currentValue >= bestValue;
case 2:
return currentValue == bestValue;
case 3:
return currentValue <= bestValue;
case 4:
return currentValue < bestValue;
}
return false;
}
private bool TestValue(byte operation, int currentValue, int bestValue)
{
switch (operation)
{
case 0:
return currentValue > bestValue;
case 1:
return currentValue >= bestValue;
case 2:
return currentValue == bestValue;
case 3:
return currentValue <= bestValue;
case 4:
return currentValue < bestValue;
}
return false;
}
private void UpdateBestAttempt()
{
@ -1088,7 +1088,7 @@ namespace BizHawk.Client.EmuHawk
_cachedControlProbabilities = ControlProbabilities;
_logGenerator = Global.MovieSession.LogGeneratorInstance();
_logGenerator.SetSource(Global.ClickyVirtualPadController);
}
}
private bool CanStart()
{
@ -1212,7 +1212,7 @@ namespace BizHawk.Client.EmuHawk
if (TieBreak2BestRadio.Checked && _bestBotAttempt.TieBreak2 != _comparisonBotAttempt.TieBreak2)
{
_comparisonBotAttempt.TieBreak2 = _bestBotAttempt.TieBreak2;
}
}
if (TieBreak3BestRadio.Checked && _bestBotAttempt.TieBreak3 != _comparisonBotAttempt.TieBreak3)
{
@ -1228,7 +1228,7 @@ namespace BizHawk.Client.EmuHawk
{
this.MainValueNumeric.Enabled = false;
_comparisonBotAttempt.Maximize = _bestBotAttempt == null ? 0 : _bestBotAttempt.Maximize;
}
}
}
private void Tiebreak1BestRadio_CheckedChanged(object sender, EventArgs e)
@ -1268,7 +1268,7 @@ namespace BizHawk.Client.EmuHawk
{
this.MainValueNumeric.Enabled = true;
_comparisonBotAttempt.Maximize = (int)this.MainValueNumeric.Value;
}
}
}
private void TieBreak1ValueRadio_CheckedChanged(object sender, EventArgs e)

View File

@ -169,12 +169,12 @@ namespace BizHawk.Client.EmuHawk
lvi[4] = string.Format("of {0} Bytes", kvp.Value.Length);
for (int i = 0; i < 8; i++)
{
if (tsbViewStyle.SelectedIndex == 0)
lvi[5 + i] = string.Format("{0:0.00}%", totals[i] / (float)kvp.Value.Length * 100f);
if (tsbViewStyle.SelectedIndex == 1)
lvi[5 + i] = string.Format("{0}", totals[i]);
if (tsbViewStyle.SelectedIndex == 2)
lvi[5 + i] = string.Format("{0:0.00}", totals[i] / 1024.0f);
if (tsbViewStyle.SelectedIndex == 0)
lvi[5 + i] = string.Format("{0:0.00}%", totals[i] / (float)kvp.Value.Length * 100f);
if (tsbViewStyle.SelectedIndex == 1)
lvi[5 + i] = string.Format("{0}", totals[i]);
if (tsbViewStyle.SelectedIndex == 2)
lvi[5 + i] = string.Format("{0:0.00}", totals[i] / 1024.0f);
}
}

View File

@ -30,7 +30,7 @@ namespace BizHawk.Client.EmuHawk
// other emulators use "vivid color" modes, such as:
// r' = 8.25r
// g' = 8.25g
// b' = 8.25b
// b' = 8.25b
// gambatte doesn't modify these memory locations unless you reconstruct, so we can store
private IntPtr _vram;

View File

@ -756,7 +756,7 @@ namespace BizHawk.Client.EmuHawk
default:
case 1:
return Watch.GenerateWatch(_domain, address, WatchSize.Byte, Client.Common.DisplayType.Hex, BigEndian, string.Empty);
case 2:
case 2:
return Watch.GenerateWatch(_domain, address, WatchSize.Word, Client.Common.DisplayType.Hex, BigEndian, string.Empty);
case 4:
return Watch.GenerateWatch(_domain, address, WatchSize.DWord, Client.Common.DisplayType.Hex, BigEndian, string.Empty);

View File

@ -545,16 +545,16 @@ namespace BizHawk.Client.EmuHawk
int? fontsize = null,
string fontfamily = null,
string fontstyle = null,
string horizalign = null,
string vertalign = null)
string horizalign = null,
string vertalign = null)
{
DrawText(x, y, message, forecolor, backcolor, fontsize, fontfamily, fontstyle, horizalign, vertalign);
}
[LuaMethodAttributes(
"drawText",
"Draws the given message in the emulator screen space (like all draw functions) at the given x,y coordinates and the given color. The default color is white. A fontfamily can be specified and is monospace generic if none is specified (font family options are the same as the .NET FontFamily class). The fontsize default is 12. The default font style is regular. Font style options are regular, bold, italic, strikethrough, underline. Horizontal alignment options are left (default), center, or right. Vertical alignment options are bottom (default), middle, or top. Alignment options specify which ends of the text will be drawn at the x and y coordinates."
)]
"Draws the given message in the emulator screen space (like all draw functions) at the given x,y coordinates and the given color. The default color is white. A fontfamily can be specified and is monospace generic if none is specified (font family options are the same as the .NET FontFamily class). The fontsize default is 12. The default font style is regular. Font style options are regular, bold, italic, strikethrough, underline. Horizontal alignment options are left (default), center, or right. Vertical alignment options are bottom (default), middle, or top. Alignment options specify which ends of the text will be drawn at the x and y coordinates."
)]
public void DrawText(
int x,
int y,
@ -564,8 +564,8 @@ namespace BizHawk.Client.EmuHawk
int? fontsize = null,
string fontfamily = null,
string fontstyle = null,
string horizalign = null,
string vertalign = null)
string horizalign = null,
string vertalign = null)
{
using (var g = GetGraphics())
{
@ -600,42 +600,42 @@ namespace BizHawk.Client.EmuHawk
}
}
// The text isn't written out using GenericTypographic, so measuring it using GenericTypographic seemed to make it worse.
// And writing it out with GenericTypographic just made it uglier. :p
StringFormat f = new StringFormat(StringFormat.GenericDefault);
var font = new Font(family, fontsize ?? 12, fstyle, GraphicsUnit.Pixel);
// The text isn't written out using GenericTypographic, so measuring it using GenericTypographic seemed to make it worse.
// And writing it out with GenericTypographic just made it uglier. :p
StringFormat f = new StringFormat(StringFormat.GenericDefault);
var font = new Font(family, fontsize ?? 12, fstyle, GraphicsUnit.Pixel);
Size sizeOfText = g.MeasureString(message, font, 0, f).ToSize();
if (horizalign != null)
{
switch (horizalign.ToLower())
{
default:
case "left":
break;
case "center":
x -= sizeOfText.Width / 2;
break;
case "right":
x -= sizeOfText.Width;
break;
}
}
if (vertalign != null)
{
switch (vertalign.ToLower())
{
default:
case "bottom":
break;
case "middle":
y -= sizeOfText.Height / 2;
break;
case "top":
y -= sizeOfText.Height;
break;
}
}
Rectangle rect = new Rectangle(new Point(x, y), sizeOfText);
if (horizalign != null)
{
switch (horizalign.ToLower())
{
default:
case "left":
break;
case "center":
x -= sizeOfText.Width / 2;
break;
case "right":
x -= sizeOfText.Width;
break;
}
}
if (vertalign != null)
{
switch (vertalign.ToLower())
{
default:
case "bottom":
break;
case "middle":
y -= sizeOfText.Height / 2;
break;
case "top":
y -= sizeOfText.Height;
break;
}
}
Rectangle rect = new Rectangle(new Point(x, y), sizeOfText);
g.FillRectangle(GetBrush(backcolor ?? DefaultTextBackground.Value), rect);
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
g.DrawString(message, font, GetBrush(forecolor ?? DefaultForeground), x, y);

View File

@ -225,7 +225,7 @@ namespace BizHawk.Client.EmuHawk
watcher.Changed += new FileSystemEventHandler(OnChanged);
_watches.Add(watcher);
}
}
private void OnChanged(object source, FileSystemEventArgs e)
{
@ -634,7 +634,7 @@ namespace BizHawk.Client.EmuHawk
}
AddFileWatches();
}
}
public bool AskSaveChanges()
{
@ -1079,7 +1079,7 @@ namespace BizHawk.Client.EmuHawk
if (Global.Config.LuaReloadOnScriptFileChange)
{
AddFileWatches();
}
}
else
{
_watches.Clear();

View File

@ -426,7 +426,7 @@ namespace BizHawk.Client.EmuHawk
void DebugCallback()
{
//fpulse = fCPU/(16*(t+1)) (where fCPU is 1.789773 MHz for NTSC, 1.662607 MHz for PAL, and 1.773448 MHz for Dendy)
//ftriangle = fCPU/(32*(tval + 1))
//ftriangle = fCPU/(32*(tval + 1))
var apu = nes.apu;

View File

@ -174,13 +174,13 @@ namespace BizHawk.Client.EmuHawk
offsetY = 1;
if (CurrentTasMovie.Markers.IsMarker(index) && Settings.DenoteMarkersWithIcons)
bitmap = icon_marker;
bitmap = icon_marker;
else if (record.HasState && Settings.DenoteStatesWithIcons)
{
if (record.Lagged.HasValue && record.Lagged.Value)
bitmap = icon_anchor_lag;
else
bitmap = icon_anchor;
if (record.Lagged.HasValue && record.Lagged.Value)
bitmap = icon_anchor_lag;
else
bitmap = icon_anchor;
}
}
}
@ -196,10 +196,10 @@ namespace BizHawk.Client.EmuHawk
}
string columnName = column.Name;
if (columnName == CursorColumnName)
color = Color.FromArgb(0xFEFFFF);
color = Color.FromArgb(0xFEFFFF);
if (columnName == FrameColumnName)
{
if (Emulator.Frame != index && CurrentTasMovie.Markers.IsMarker(index) && Settings.DenoteMarkersWithBGColor)
@ -234,13 +234,13 @@ namespace BizHawk.Client.EmuHawk
else if (record.Lagged.HasValue)
{
if (!record.HasState && Settings.DenoteStatesWithBGColor)
color = record.Lagged.Value ?
LagZone_InputLog :
GreenZone_InputLog;
else
color = record.Lagged.Value ?
LagZone_InputLog_Stated :
GreenZone_InputLog_Stated;
color = record.Lagged.Value ?
LagZone_InputLog :
GreenZone_InputLog;
else
color = record.Lagged.Value ?
LagZone_InputLog_Stated :
GreenZone_InputLog_Stated;
}
else if (record.WasLagged.HasValue)
{
@ -757,10 +757,10 @@ namespace BizHawk.Client.EmuHawk
e.NewCell == null || e.NewCell.RowIndex == null || e.NewCell.Column == null)
{
return;
}
}
// skip rerecord counting on drawing entirely, mouse down is enough
// avoid introducing another global
// skip rerecord counting on drawing entirely, mouse down is enough
// avoid introducing another global
bool wasCountingRerecords = Global.MovieSession.Movie.IsCountingRerecords;
WasRecording = CurrentTasMovie.IsRecording || WasRecording;
@ -914,8 +914,8 @@ namespace BizHawk.Client.EmuHawk
}
else if (TasView.IsPaintDown && e.NewCell.RowIndex.HasValue && !string.IsNullOrEmpty(_startFloatDrawColumn))
{
Global.MovieSession.Movie.IsCountingRerecords = false;
{
Global.MovieSession.Movie.IsCountingRerecords = false;
if (e.OldCell.RowIndex.HasValue && e.NewCell.RowIndex.HasValue)
{
@ -941,7 +941,7 @@ namespace BizHawk.Client.EmuHawk
}
}
Global.MovieSession.Movie.IsCountingRerecords = wasCountingRerecords;
Global.MovieSession.Movie.IsCountingRerecords = wasCountingRerecords;
if (mouseButtonHeld)
{

View File

@ -698,7 +698,7 @@ namespace BizHawk.Client.EmuHawk
private void RemoveMarkersMenuItem_Click(object sender, EventArgs e)
{
IEnumerable<TasMovieMarker> markers = CurrentTasMovie.Markers.Where(m => TasView.SelectedRows.Contains(m.Frame));
foreach (TasMovieMarker m in markers.ToList())
foreach (TasMovieMarker m in markers.ToList())
{
CurrentTasMovie.Markers.Remove(m);
}
@ -1072,31 +1072,31 @@ namespace BizHawk.Client.EmuHawk
private void scrollToCenterToolStripMenuItem_Click(object sender, EventArgs e)
{
TasView.ScrollMethod = Settings.FollowCursorScrollMethod = "center";
}
}
private void DenoteStatesWithIconsToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings.DenoteStatesWithIcons = DenoteStatesWithIconsToolStripMenuItem.Checked;
RefreshDialog();
}
private void DenoteStatesWithIconsToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings.DenoteStatesWithIcons = DenoteStatesWithIconsToolStripMenuItem.Checked;
RefreshDialog();
}
private void DenoteStatesWithBGColorToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings.DenoteStatesWithBGColor = DenoteStatesWithBGColorToolStripMenuItem.Checked;
RefreshDialog();
}
private void DenoteStatesWithBGColorToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings.DenoteStatesWithBGColor = DenoteStatesWithBGColorToolStripMenuItem.Checked;
RefreshDialog();
}
private void DenoteMarkersWithIconsToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings.DenoteMarkersWithIcons = DenoteMarkersWithIconsToolStripMenuItem.Checked;
RefreshDialog();
}
private void DenoteMarkersWithIconsToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings.DenoteMarkersWithIcons = DenoteMarkersWithIconsToolStripMenuItem.Checked;
RefreshDialog();
}
private void DenoteMarkersWithBGColorToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings.DenoteMarkersWithBGColor = DenoteMarkersWithBGColorToolStripMenuItem.Checked;
RefreshDialog();
}
private void DenoteMarkersWithBGColorToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings.DenoteMarkersWithBGColor = DenoteMarkersWithBGColorToolStripMenuItem.Checked;
RefreshDialog();
}
private void wheelScrollSpeedToolStripMenuItem_Click(object sender, EventArgs e)
{

View File

@ -68,11 +68,11 @@ namespace BizHawk.Client.EmuHawk
AutosaveAsBackupFile = false;
BackupPerFileSave = false;
SingleClickFloatEdit = false;
// default to taseditor fashion
DenoteStatesWithIcons = false;
DenoteStatesWithBGColor = true;
DenoteMarkersWithIcons = false;
DenoteMarkersWithBGColor = true;
// default to taseditor fashion
DenoteStatesWithIcons = false;
DenoteStatesWithBGColor = true;
DenoteMarkersWithIcons = false;
DenoteMarkersWithBGColor = true;
}
public RecentFiles RecentTas { get; set; }
@ -83,7 +83,7 @@ namespace BizHawk.Client.EmuHawk
public bool EmptyMarkers { get; set; }
public int ScrollSpeed { get; set; }
public bool FollowCursorAlwaysScroll { get; set; }
public string FollowCursorScrollMethod { get; set; }
public string FollowCursorScrollMethod { get; set; }
public int BranchCellHoverInterval { get; set; }
public int SeekingCutoffInterval { get; set; }
public bool AutoRestoreOnMouseUpOnly { get; set; }
@ -92,10 +92,10 @@ namespace BizHawk.Client.EmuHawk
public bool AutosaveAsBackupFile { get; set; }
public bool BackupPerFileSave { get; set; }
public bool SingleClickFloatEdit { get; set; }
public bool DenoteStatesWithIcons { get; set; }
public bool DenoteStatesWithBGColor { get; set; }
public bool DenoteMarkersWithIcons { get; set; }
public bool DenoteMarkersWithBGColor { get; set; }
public bool DenoteStatesWithIcons { get; set; }
public bool DenoteStatesWithBGColor { get; set; }
public bool DenoteMarkersWithIcons { get; set; }
public bool DenoteMarkersWithBGColor { get; set; }
public int MainVerticalSplitDistance { get; set; }
public int BranchMarkerSplitDistance { get; set; }
}

View File

@ -5,10 +5,10 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("PCECD")]
public class PceCdSchema : PceSchema { }
[SchemaAttributes("PCECD")]
public class PceCdSchema : PceSchema { }
[SchemaAttributes("PCE")]
[SchemaAttributes("PCE")]
public class PceSchema : IVirtualPadSchema
{
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)

View File

@ -655,7 +655,7 @@ namespace BizHawk.Client.EmuHawk
private void SetSize(WatchSize size)
{
_settings.Size = size;
SpecificValueBox.ByteSize = size;
SpecificValueBox.ByteSize = size;
if (!string.IsNullOrEmpty(SpecificAddressBox.Text))
{
SpecificAddressBox.Text = "0";

View File

@ -106,7 +106,7 @@ namespace BizHawk.Client.EmuHawk
public bool UpdateBefore => false;
#region API
#region API
public void AddWatch(Watch watch)
{
@ -391,15 +391,15 @@ namespace BizHawk.Client.EmuHawk
if (SelectedWatches.Any())
{
foreach (var sw in SelectedWatches)
{
if (sw.Domain != SelectedWatches.First().Domain)
{
throw new InvalidOperationException("Can't edit multiple watches on varying memorydomains");
}
}
foreach (var sw in SelectedWatches)
{
if (sw.Domain != SelectedWatches.First().Domain)
{
throw new InvalidOperationException("Can't edit multiple watches on varying memorydomains");
}
}
var we = new WatchEditor
var we = new WatchEditor
{
InitialLocation = this.ChildPointToScreen(WatchListView),
MemoryDomains = _memoryDomains

View File

@ -163,7 +163,7 @@ namespace BizHawk.Client.EmuHawk
foreach(DisplayType t in ByteWatch.ValidTypes)
{
DisplayTypeDropDown.Items.Add(Watch.DisplayTypeToString(t));
}
}
break;
case 1:
foreach (DisplayType t in WordWatch.ValidTypes)
@ -313,7 +313,7 @@ namespace BizHawk.Client.EmuHawk
_watchList[i].Type,
_watchList[i].BigEndian,
_watchList[i].Notes
);
);
}
}

View File

@ -75,35 +75,35 @@ namespace BizHawk.Client.MultiHawk
return false;
}
public static bool ShiftModifier
{
get
{
if (state.IsPressed(Key.LeftShift)) return true;
if (state.IsPressed(Key.RightShift)) return true;
return false;
}
}
public static bool ShiftModifier
{
get
{
if (state.IsPressed(Key.LeftShift)) return true;
if (state.IsPressed(Key.RightShift)) return true;
return false;
}
}
public static bool CtrlModifier
{
get
{
if (state.IsPressed(Key.LeftControl)) return true;
if (state.IsPressed(Key.RightControl)) return true;
return false;
}
}
public static bool CtrlModifier
{
get
{
if (state.IsPressed(Key.LeftControl)) return true;
if (state.IsPressed(Key.RightControl)) return true;
return false;
}
}
public static bool AltModifier
{
get
{
if (state.IsPressed(Key.LeftAlt)) return true;
if (state.IsPressed(Key.RightAlt)) return true;
return false;
}
}
public static bool AltModifier
{
get
{
if (state.IsPressed(Key.LeftAlt)) return true;
if (state.IsPressed(Key.RightAlt)) return true;
return false;
}
}
public static Input.ModifierKey GetModifierKeysAsKeys()
{
@ -116,17 +116,17 @@ namespace BizHawk.Client.MultiHawk
}
internal static class KeyExtensions
{
public static bool IsModifier(this Key key)
{
if (key == Key.LeftShift) return true;
if (key == Key.RightShift) return true;
if (key == Key.LeftControl) return true;
if (key == Key.RightControl) return true;
if (key == Key.LeftAlt) return true;
if (key == Key.RightAlt) return true;
return false;
}
}
internal static class KeyExtensions
{
public static bool IsModifier(this Key key)
{
if (key == Key.LeftShift) return true;
if (key == Key.RightShift) return true;
if (key == Key.LeftControl) return true;
if (key == Key.RightControl) return true;
if (key == Key.LeftAlt) return true;
if (key == Key.RightAlt) return true;
return false;
}
}
}

View File

@ -188,9 +188,9 @@ namespace BizHawk.Common.ReflectionExtensions
return (T)o.GetType().GetCustomAttributes(typeof(T), false)[0];
}
/// <summary>
/// where the fields begin relative to the address an object references points to
/// </summary>
/// <summary>
/// where the fields begin relative to the address an object references points to
/// </summary>
public static IntPtr ManagedFieldStart => _managedfieldstart;
[StructLayout(LayoutKind.Explicit)]

View File

@ -60,57 +60,57 @@ namespace BizHawk.Common
/// </summary>
public bool Exists => _exists;
/// <summary>
/// <summary>
/// Gets the directory containing the root
/// </summary>
public string Directory => Path.GetDirectoryName(_rootPath);
/// <summary>
/// <summary>
/// Gets a value indicating whether this instance is bound
/// </summary>
public bool IsBound => _boundStream != null;
/// <summary>
/// <summary>
/// returns the complete canonical full path ("c:\path\to\archive|member") of the bound file
/// </summary>
public string CanonicalFullPath => MakeCanonicalName(_rootPath, _memberPath);
/// <summary>
/// <summary>
/// returns the complete canonical name ("archive|member") of the bound file
/// </summary>
public string CanonicalName => MakeCanonicalName(Path.GetFileName(_rootPath), _memberPath);
/// <summary>
/// <summary>
/// returns the virtual name of the bound file (disregarding the archive)
/// </summary>
public string Name => GetBoundNameFromCanonical(MakeCanonicalName(_rootPath, _memberPath));
/// <summary>
/// <summary>
/// returns the complete full path of the bound file, excluding the archive member portion
/// </summary>
public string FullPathWithoutMember => _rootPath;
/// <summary>
/// <summary>
/// returns the member path part of the bound file
/// </summary>
public string ArchiveMemberPath => _memberPath;
/// <summary>
/// <summary>
/// returns the extension of Name
/// </summary>
public string Extension => Path.GetExtension(Name).ToUpper();
/// <summary>
/// <summary>
/// Indicates whether this file is an archive
/// </summary>
public bool IsArchive => _isArchive;
/// <summary>
/// <summary>
/// Indicates whether the file is an archive member (IsArchive && IsBound[to member])
/// </summary>
public bool IsArchiveMember => IsArchive && IsBound;
public IList<HawkFileArchiveItem> ArchiveItems
public IList<HawkFileArchiveItem> ArchiveItems
{
get
{

View File

@ -14,7 +14,7 @@
public int Count => _count;
public void Clear()
public void Clear()
{
_head = 0;
_count = 0;

View File

@ -26,13 +26,13 @@ namespace BizHawk.Common
public override bool CanRead => _currStream.CanRead;
public override bool CanSeek => _currStream.CanSeek;
public override bool CanSeek => _currStream.CanSeek;
public override bool CanWrite => _currStream.CanWrite;
public override bool CanWrite => _currStream.CanWrite;
public override long Length => _currStream.Length;
public override long Length => _currStream.Length;
public override long Position
public override long Position
{
get
{

View File

@ -26,11 +26,11 @@ namespace BizHawk.Common
public bool CanUndo => Enabled && _curPos > 1;
public bool CanRedo => Enabled && _curPos < _history.Count;
public bool CanRedo => Enabled && _curPos < _history.Count;
public bool HasHistory => Enabled && _history.Any();
public bool HasHistory => Enabled && _history.Any();
public void Clear()
public void Clear()
{
_history = new List<List<T>>();
_curPos = 0;

View File

@ -52,7 +52,7 @@ namespace BizHawk.Emulation.Common
public bool Enabled => Sink != null;
public void Put(TraceInfo info)
public void Put(TraceInfo info)
{
Sink.Put(info);
}
@ -86,9 +86,9 @@ namespace BizHawk.Emulation.Common
public MemoryCallbackType Type => MemoryCallbackType.Execute;
public string Name => "Trace Logging";
public string Name => "Trace Logging";
public Action Callback { get; }
public Action Callback { get; }
public uint? Address => null;

View File

@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Common
{
if ((hadAny && !hasAny) || (!hadAny && hasAny))
{
ActiveChanged?.Invoke();
ActiveChanged?.Invoke();
}
}
}

View File

@ -98,11 +98,11 @@ namespace BizHawk.Emulation.Common
public bool HasReads => _hasReads;
public bool HasWrites => _hasWrites;
public bool HasWrites => _hasWrites;
public bool HasExecutes => _hasExecutes;
public bool HasExecutes => _hasExecutes;
private void UpdateHasVariables()
private void UpdateHasVariables()
{
_hasReads = Reads.Count > 0;
_hasWrites = Writes.Count > 0;
@ -210,7 +210,7 @@ namespace BizHawk.Emulation.Common
private void Changes()
{
ActiveChanged?.Invoke();
ActiveChanged?.Invoke();
}
public void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
@ -220,13 +220,13 @@ namespace BizHawk.Emulation.Common
case NotifyCollectionChangedAction.Add:
foreach(IMemoryCallback callback in args.NewItems)
{
CallbackAdded?.Invoke(callback);
CallbackAdded?.Invoke(callback);
}
break;
case NotifyCollectionChangedAction.Remove:
foreach(IMemoryCallback callback in args.OldItems)
{
CallbackRemoved?.Invoke(callback);
CallbackRemoved?.Invoke(callback);
}
break;
}

View File

@ -115,7 +115,7 @@ namespace BizHawk.Emulation.Common
{
var d1 = dest as T;
var s1 = src as T;
if (d1 != null && s1 != null)
if (d1 != null && s1 != null)
{
func(d1, s1);
}

View File

@ -14,7 +14,7 @@
public bool this[string button] => false;
public bool IsPressed(string button)
public bool IsPressed(string button)
{
return false;
}

View File

@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Common
public ControllerDefinition ControllerDefinition => NullController.Instance.Definition;
public IController Controller { get; set; }
public IController Controller { get; set; }
public void FrameAdvance(bool render, bool rendersound)
{
@ -78,16 +78,16 @@ namespace BizHawk.Emulation.Common
public string SystemId => "NULL";
public bool DeterministicEmulation => true;
public bool DeterministicEmulation => true;
public void ResetCounters()
public void ResetCounters()
{
Frame = 0;
}
public string BoardName => null;
public CoreComm CoreComm { get; }
public CoreComm CoreComm { get; }
public void Dispose()
{
@ -104,15 +104,15 @@ namespace BizHawk.Emulation.Common
public int VirtualWidth => 256;
public int VirtualHeight => 192;
public int VirtualHeight => 192;
public int BufferWidth => 256;
public int BufferWidth => 256;
public int BufferHeight => 192;
public int BufferHeight => 192;
public int BackgroundColor => 0;
public int BackgroundColor => 0;
#endregion
#endregion
#region ISoundProvider
@ -160,7 +160,7 @@ namespace BizHawk.Emulation.Common
public bool CanProvideAsync => true;
public SyncSoundMode SyncMode { get; private set; }
public SyncSoundMode SyncMode { get; private set; }
public void SetSyncMode(SyncSoundMode mode)
{

View File

@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Common
public bool CanProvideAsync => true;
public SyncSoundMode SyncMode { get; private set; }
public SyncSoundMode SyncMode { get; private set; }
public void GetSamplesSync(out short[] samples, out int nsamp)
{

View File

@ -14,15 +14,15 @@
public int VirtualWidth => 256;
public int VirtualHeight => 192;
public int VirtualHeight => 192;
public int BufferWidth => 256;
public int BufferWidth => 256;
public int BufferHeight => 192;
public int BufferHeight => 192;
public int BackgroundColor => 0;
public int BackgroundColor => 0;
private static readonly NullVideo _nullVideo = new NullVideo();
private static readonly NullVideo _nullVideo = new NullVideo();
public static NullVideo Instance => _nullVideo;
}

View File

@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Common.Base_Implementations
public bool CanProvideAsync => false;
public void SetSyncMode(SyncSoundMode mode)
public void SetSyncMode(SyncSoundMode mode)
{
if (mode != SyncSoundMode.Sync)
{
@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Common.Base_Implementations
public SyncSoundMode SyncMode => SyncSoundMode.Sync;
/// <summary>
/// <summary>
/// Add samples to be output. no queueing; must be drained every frame
/// </summary>
/// <param name="samples"></param>

View File

@ -475,7 +475,7 @@ namespace BizHawk.Emulation.Common.BizInvoke
{
public CallingConvention CallingConvention { get; }
/// <summary>
/// <summary>
/// name of entry point; if not given, the method's name is used
/// </summary>
public string EntryPoint { get; set; }

View File

@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Common
public double VsyncRate => VsyncNum / (double)VsyncDen;
public int VsyncNum = 60;
public int VsyncNum = 60;
public int VsyncDen = 1;
// a core should set these if you wish to provide rom status information yourself. otherwise it will be calculated by the frontend in a way you may not like, using RomGame-related concepts.

View File

@ -50,12 +50,12 @@ namespace BizHawk.Emulation.Common
FirmwareAndOption("1D503E56DF85A62FEE696E7618DC5B4E781DF1BB", 8192, "C64", "Kernal", "c64-kernal.bin", "Kernal Rom");
FirmwareAndOption("79015323128650C742A3694C9429AA91F355905E", 8192, "C64", "Basic", "c64-basic.bin", "Basic Rom");
FirmwareAndOption("ADC7C31E18C7C7413D54802EF2F4193DA14711AA", 4096, "C64", "Chargen", "c64-chargen.bin", "Chargen Rom");
FirmwareAndOption("AB16F56989B27D89BABE5F89C5A8CB3DA71A82F0", 16384, "C64", "Drive1541", "drive-1541.bin", "1541 Disk Drive Rom");
FirmwareAndOption("D3B78C3DBAC55F5199F33F3FE0036439811F7FB3", 16384, "C64", "Drive1541II", "drive-1541ii.bin", "1541-II Disk Drive Rom");
FirmwareAndOption("AB16F56989B27D89BABE5F89C5A8CB3DA71A82F0", 16384, "C64", "Drive1541", "drive-1541.bin", "1541 Disk Drive Rom");
FirmwareAndOption("D3B78C3DBAC55F5199F33F3FE0036439811F7FB3", 16384, "C64", "Drive1541II", "drive-1541ii.bin", "1541-II Disk Drive Rom");
//for saturn, we think any bios region can pretty much run any iso
//so, we're going to lay this out carefully so that we choose things in a sensible order, but prefer the correct region
var ss_100_j = File("2B8CB4F87580683EB4D760E4ED210813D667F0A2", 524288, "saturn-1.00-(J).bin", "Bios v1.00 (J)");
//for saturn, we think any bios region can pretty much run any iso
//so, we're going to lay this out carefully so that we choose things in a sensible order, but prefer the correct region
var ss_100_j = File("2B8CB4F87580683EB4D760E4ED210813D667F0A2", 524288, "saturn-1.00-(J).bin", "Bios v1.00 (J)");
var ss_100_ue = File("FAA8EA183A6D7BBE5D4E03BB1332519800D3FBC3", 524288, "saturn-1.00-(U+E).bin", "Bios v1.00 (U+E)");
var ss_100a_ue = File("3BB41FEB82838AB9A35601AC666DE5AACFD17A58", 524288, "saturn-1.00a-(U+E).bin", "Bios v1.00a (U+E)"); //?? is this size correct?
var ss_101_j = File("DF94C5B4D47EB3CC404D88B33A8FDA237EAF4720", 524288, "saturn-1.01-(J).bin", "Bios v1.01 (J)"); //?? is this size correct?

View File

@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Common
{
public ServiceNotApplicable(params Type[] types)
{
NotApplicableTypes = types?.ToList() ?? new List<Type>();
NotApplicableTypes = types?.ToList() ?? new List<Type>();
}
public IEnumerable<Type> NotApplicableTypes { get; private set; }

View File

@ -138,9 +138,9 @@ namespace BizHawk.Emulation.Common
public SyncSoundMode SyncMode => _soundProvider.SyncMode;
public bool CanProvideAsync => _soundProvider.CanProvideAsync;
public bool CanProvideAsync => _soundProvider.CanProvideAsync;
public void SetSyncMode(SyncSoundMode mode)
public void SetSyncMode(SyncSoundMode mode)
{
_soundProvider.SetSyncMode(mode);
}

View File

@ -36,9 +36,9 @@ namespace BizHawk.Emulation.Common
public bool CanProvideAsync => true;
public SyncSoundMode SyncMode => SyncSoundMode.Async;
public SyncSoundMode SyncMode => SyncSoundMode.Async;
public void SetSyncMode(SyncSoundMode mode)
public void SetSyncMode(SyncSoundMode mode)
{
if (mode != SyncSoundMode.Async)
{
@ -262,7 +262,7 @@ namespace BizHawk.Emulation.Common
public ssamp(short ll, short rr) { l = ll; r = rr; }
};
readonly List<ssamp> sampleQueue = new List<ssamp>();
readonly List<ssamp> sampleQueue = new List<ssamp>();
// returns values going between 0 and y-1 in a saw wave pattern, based on x
static int pingpong(int x, int y)

View File

@ -310,18 +310,18 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
case 0x026:
case 0x027:
dest = (byte)(opcode & 0x7);
dest_value = Register[dest];
var ones = (dest_value ^ 0xFFFF);
result = ones + 1;
Calc_FlagC(result);
Calc_FlagO_Add(ones, 1, result);
result &= 0xFFFF;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 6;
Interruptible = true;
break;
dest_value = Register[dest];
var ones = (dest_value ^ 0xFFFF);
result = ones + 1;
Calc_FlagC(result);
Calc_FlagO_Add(ones, 1, result);
result &= 0xFFFF;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 6;
Interruptible = true;
break;
// ADCR
case 0x028:
case 0x029:
@ -332,18 +332,18 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
case 0x02E:
case 0x02F:
dest = (byte)(opcode & 0x7);
dest_value = Register[dest];
var carry = FlagC ? 1 : 0;
result = dest_value + carry;
Calc_FlagC(result);
Calc_FlagO_Add(dest_value, carry, result);
result &= 0xFFFF;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 6;
Interruptible = true;
break;
dest_value = Register[dest];
var carry = FlagC ? 1 : 0;
result = dest_value + carry;
Calc_FlagC(result);
Calc_FlagO_Add(dest_value, carry, result);
result &= 0xFFFF;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 6;
Interruptible = true;
break;
// GSWD
case 0x030:
case 0x031:
@ -1008,15 +1008,15 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
case 0x1BD:
case 0x1BE:
case 0x1BF:
src = (byte)((opcode >> 3) & 0x7);
dest = (byte)(opcode & 0x7);
result = Register[dest] & Register[src];
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 6;
Interruptible = true;
break;
src = (byte)((opcode >> 3) & 0x7);
dest = (byte)(opcode & 0x7);
result = Register[dest] & Register[src];
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 6;
Interruptible = true;
break;
// XORR
case 0x1C0:
case 0x1C1:
@ -1510,21 +1510,21 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
case 0x305:
case 0x306:
case 0x307:
dest = (byte)(opcode & 0x7);
addr = ReadMemory(RegisterPC++, false);
dest_value = Register[dest];
addr_read = ReadMemory(addr, false);
twos = (0xFFFF ^ addr_read) + 1;
result = dest_value + twos;
Calc_FlagC(result);
dest = (byte)(opcode & 0x7);
addr = ReadMemory(RegisterPC++, false);
dest_value = Register[dest];
addr_read = ReadMemory(addr, false);
twos = (0xFFFF ^ addr_read) + 1;
result = dest_value + twos;
Calc_FlagC(result);
Calc_FlagO_Add(dest_value, twos, result);
result &= 0xFFFF;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 10;
Interruptible = true;
break;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 10;
Interruptible = true;
break;
// SUB@
case 0x308:
case 0x309:
@ -1701,16 +1701,16 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
case 0x386:
case 0x387:
dest = (byte)(opcode & 0x7);
addr = ReadMemory(RegisterPC++, false);
dest_value = Register[dest];
addr_read = ReadMemory(addr, false);
result = dest_value & addr_read;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 10;
Interruptible = true;
break;
addr = ReadMemory(RegisterPC++, false);
dest_value = Register[dest];
addr_read = ReadMemory(addr, false);
result = dest_value & addr_read;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 10;
Interruptible = true;
break;
// AND@
case 0x388:
case 0x389:
@ -1787,17 +1787,17 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
case 0x3C5:
case 0x3C6:
case 0x3C7:
dest = (byte)(opcode & 0x7);
addr = ReadMemory(RegisterPC++, false);
dest_value = Register[dest];
addr_read = ReadMemory(addr, false);
result = dest_value ^ addr_read;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 10;
Interruptible = true;
break;
dest = (byte)(opcode & 0x7);
addr = ReadMemory(RegisterPC++, false);
dest_value = Register[dest];
addr_read = ReadMemory(addr, false);
result = dest_value ^ addr_read;
Calc_FlagS(result);
Calc_FlagZ(result);
Register[dest] = (ushort)result;
cycles = 10;
Interruptible = true;
break;
// XOR@
case 0x3C8:
case 0x3C9:

View File

@ -944,8 +944,8 @@ namespace BizHawk.Emulation.Cores.Components.M6502
rdy_freeze = !RDY;
if (RDY)
{
ReadMemory((ushort)ea);
if (alu_temp.Bit(8))
ReadMemory((ushort)ea);
if (alu_temp.Bit(8))
ea = (ushort)(ea + 0x100);
}
@ -1095,7 +1095,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
void IndIdx_RMW_Stage8()
{
WriteMemory((ushort)ea, (byte)alu_temp);
}
}
void RelBranch_Stage2_BVS()
{
branch_taken = FlagV == true;
@ -1155,59 +1155,59 @@ namespace BizHawk.Emulation.Cores.Components.M6502
}
void RelBranch_Stage3()
{
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
alu_temp = (byte)PC + (int)(sbyte)opcode2;
PC &= 0xFF00;
PC |= (ushort)((alu_temp & 0xFF));
if (alu_temp.Bit(8))
{
//we need to carry the add, and then we'll be ready to fetch the next instruction
opcode = VOP_RelativeStuff2;
mi = -1;
}
else
{
//to pass cpu_interrupts_v2/5-branch_delays_irq we need to handle a quirk here
//if we decide to interrupt in the next cycle, this condition will cause it to get deferred by one instruction
if (!interrupt_pending)
branch_irq_hack = true;
}
}
}
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
alu_temp = (byte)PC + (int)(sbyte)opcode2;
PC &= 0xFF00;
PC |= (ushort)((alu_temp & 0xFF));
if (alu_temp.Bit(8))
{
//we need to carry the add, and then we'll be ready to fetch the next instruction
opcode = VOP_RelativeStuff2;
mi = -1;
}
else
{
//to pass cpu_interrupts_v2/5-branch_delays_irq we need to handle a quirk here
//if we decide to interrupt in the next cycle, this condition will cause it to get deferred by one instruction
if (!interrupt_pending)
branch_irq_hack = true;
}
}
}
void RelBranch_Stage4()
{
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
if (alu_temp.Bit(31))
PC = (ushort)(PC - 0x100);
else PC = (ushort)(PC + 0x100);
}
}
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
if (alu_temp.Bit(31))
PC = (ushort)(PC - 0x100);
else PC = (ushort)(PC + 0x100);
}
}
void NOP()
{
rdy_freeze = !RDY;
}
void DecS()
rdy_freeze = !RDY;
}
void DecS()
{
rdy_freeze = !RDY;
if (RDY)
{
S--;
}
}
rdy_freeze = !RDY;
if (RDY)
{
S--;
}
}
void IncS()
{
rdy_freeze = !RDY;
if (RDY)
{
S++;
}
}
rdy_freeze = !RDY;
if (RDY)
{
S++;
}
}
void JSR()
{
rdy_freeze = !RDY;
@ -2058,50 +2058,50 @@ namespace BizHawk.Emulation.Cores.Components.M6502
}
void Imp_ASL_A()
{
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
FlagC = (A & 0x80) != 0;
A = (byte)(A << 1);
NZ_A();
}
}
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
FlagC = (A & 0x80) != 0;
A = (byte)(A << 1);
NZ_A();
}
}
void Imp_ROL_A()
{
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
temp8 = A;
A = (byte)((A << 1) | (P & 1));
FlagC = (temp8 & 0x80) != 0;
NZ_A();
}
}
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
temp8 = A;
A = (byte)((A << 1) | (P & 1));
FlagC = (temp8 & 0x80) != 0;
NZ_A();
}
}
void Imp_ROR_A()
{
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
temp8 = A;
A = (byte)((A >> 1) | ((P & 1) << 7));
FlagC = (temp8 & 1) != 0;
NZ_A();
}
}
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
temp8 = A;
A = (byte)((A >> 1) | ((P & 1) << 7));
FlagC = (temp8 & 1) != 0;
NZ_A();
}
}
void Imp_LSR_A()
{
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
FlagC = (A & 1) != 0;
A = (byte)(A >> 1);
NZ_A();
}
}
rdy_freeze = !RDY;
if (RDY)
{
FetchDummy();
FlagC = (A & 1) != 0;
A = (byte)(A >> 1);
NZ_A();
}
}
void JMP_abs()
{
rdy_freeze = !RDY;
@ -2275,9 +2275,9 @@ namespace BizHawk.Emulation.Cores.Components.M6502
rdy_freeze = !RDY;
if (RDY)
{
//bleh.. redundant code to make sure we dont clobber alu_temp before using it to decide whether to change ea
//bleh.. redundant code to make sure we dont clobber alu_temp before using it to decide whether to change ea
if (alu_temp.Bit(8))
if (alu_temp.Bit(8))
{
alu_temp = ReadMemory((ushort)ea);
ea = (ushort)(ea + 0x100);
@ -2307,10 +2307,10 @@ namespace BizHawk.Emulation.Cores.Components.M6502
}
void AbsIdx_WRITE_Stage5_ERROR()
{
S = (byte)(X & A);
WriteMemory((ushort)ea, (byte)(S & (opcode3+1)));
S = (byte)(X & A);
WriteMemory((ushort)ea, (byte)(S & (opcode3+1)));
}
}
void AbsIdx_RMW_Stage5()
{
rdy_freeze = !RDY;
@ -2529,11 +2529,11 @@ namespace BizHawk.Emulation.Cores.Components.M6502
if (RDY)
{
alu_temp = ReadMemory((ushort)ea);
S &= (byte)alu_temp;
X = S;
A = S;
P = (byte)((P & 0x7D) | TableNZ[S]);
}
S &= (byte)alu_temp;
X = S;
A = S;
P = (byte)((P & 0x7D) | TableNZ[S]);
}
}
void AbsInd_JMP_Stage4()
@ -2967,9 +2967,9 @@ namespace BizHawk.Emulation.Cores.Components.M6502
public void ExecuteOne()
{
// total cycles now incraments every time a cycle is called to accurately count during RDY
TotalExecutedCycles++;
if (!rdy_freeze)
// total cycles now incraments every time a cycle is called to accurately count during RDY
TotalExecutedCycles++;
if (!rdy_freeze)
{

View File

@ -248,11 +248,11 @@ namespace BizHawk.Emulation.Cores.Components.M6502
return (ushort)(ReadMemory(address) | (ReadMemory(highAddress) << 8));
}
// SO pin
public void SetOverflow()
{
FlagV = true;
}
// SO pin
public void SetOverflow()
{
FlagV = true;
}
private static readonly byte[] TableNZ =
{

View File

@ -128,7 +128,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80
readonly static string[] mnemonics = new string[]
{
"NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04
"NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04
"INC B", "DEC B", "LD B, n", "RLCA", //0x08
"EX AF, AF'", "ADD HL, BC", "LD A, (BC)", "DEC BC", //0x0C
"INC C", "DEC C", "LD C, n", "RRCA", //0x10

View File

@ -43,12 +43,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
if ((addr & 0x1080) == 0x0080)
{
_tia.bus_state = M6532.ReadMemory(addr, false);
return M6532.ReadMemory(addr, false);
_tia.bus_state = M6532.ReadMemory(addr, false);
return M6532.ReadMemory(addr, false);
}
_tia.bus_state = Rom[addr & 0x0FFF];
return Rom[addr & 0x0FFF];
_tia.bus_state = Rom[addr & 0x0FFF];
return Rom[addr & 0x0FFF];
}
internal byte BasePeekMemory(ushort addr)
@ -61,15 +61,15 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
if ((addr & 0x1080) == 0x0080)
{
return M6532.ReadMemory(addr, true);
return M6532.ReadMemory(addr, true);
}
return Rom[addr & 0x0FFF];
return Rom[addr & 0x0FFF];
}
internal void BaseWriteMemory(ushort addr, byte value)
{
_tia.bus_state = value;
if (addr != LastAddress)
_tia.bus_state = value;
if (addr != LastAddress)
{
DistinctAccessCount++;
LastAddress = addr;
@ -92,7 +92,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
internal void BasePokeMemory(ushort addr, byte value)
{
addr = (ushort)(addr & 0x1FFF);
addr = (ushort)(addr & 0x1FFF);
if ((addr & 0x1080) == 0)
{
_tia.WriteMemory(addr, value, true);
@ -117,7 +117,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
_mapper.Bit13 = addr.Bit(13);
var temp = _mapper.ReadMemory((ushort)(addr & 0x1FFF));
_tia.bus_state = temp;
_tia.bus_state = temp;
MemoryCallbacks.CallReads(addr);
return temp;
@ -250,13 +250,13 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
_mapper = new mUA();
break;
// Special Sega Mapper which has swapped banks
case "F8_sega":
_mapper = new mF8_sega();
break;
// Special Sega Mapper which has swapped banks
case "F8_sega":
_mapper = new mF8_sega();
break;
// Homebrew mappers
case "3E":
// Homebrew mappers
case "3E":
_mapper = new m3E();
break;
case "0840":
@ -332,10 +332,10 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
_mapper.GetType());
// as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves.
// some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532
// executing a reset sequence at power on, but it's needed so let's hard code it for now
Cpu.S = 0xFD;
// as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves.
// some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532
// executing a reset sequence at power on, but it's needed so let's hard code it for now
Cpu.S = 0xFD;
}
private bool _pal;
@ -359,19 +359,19 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
M6532 = new M6532(this);
Cpu.PC = (ushort)(ReadMemory(0x1FFC) + (ReadMemory(0x1FFD) << 8)); // set the initial PC
// as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves.
// some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532
// executing a reset sequence at power on, but it's needed so let's hard code it for now
Cpu.S = 0xFD;
}
// as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves.
// some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532
// executing a reset sequence at power on, but it's needed so let's hard code it for now
Cpu.S = 0xFD;
}
public void FrameAdvance(bool render, bool rendersound)
{
StartFrameCond();
while (_tia.LineCount < _tia.NominalNumScanlines)
Cycle();
if (rendersound==false)
_tia._audioClocks = 0; // we need this here since the async sound provider won't check in this case
if (rendersound==false)
_tia._audioClocks = 0; // we need this here since the async sound provider won't check in this case
FinishFrameCond();
}

View File

@ -90,7 +90,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
public int TotalExecutedCycles => Cpu.TotalExecutedCycles;
private void StepInto()
private void StepInto()
{
do
{

View File

@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
{
public bool BinarySaveStatesPreferred => false;
public void SaveStateText(TextWriter writer)
public void SaveStateText(TextWriter writer)
{
SyncState(Serializer.CreateTextWriter(writer));
}

Some files were not shown because too many files have changed in this diff Show More