diff --git a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainList.cs b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainList.cs
index 6def6abe23..9158786005 100644
--- a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainList.cs
+++ b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainList.cs
@@ -52,14 +52,7 @@ namespace BizHawk.Emulation.Common
return _systemBus;
}
- var bus = this.FirstOrDefault(x => x.Name == "System Bus");
-
- if (bus != null)
- {
- return bus;
- }
-
- return MainMemory;
+ return this.FirstOrDefault(x => x.Name == "System Bus") ?? MainMemory;
}
set => _systemBus = value;
diff --git a/BizHawk.Emulation.Common/ControllerDefinitionMerger.cs b/BizHawk.Emulation.Common/ControllerDefinitionMerger.cs
index 77aea4c80c..80fcaa295e 100644
--- a/BizHawk.Emulation.Common/ControllerDefinitionMerger.cs
+++ b/BizHawk.Emulation.Common/ControllerDefinitionMerger.cs
@@ -76,10 +76,7 @@ namespace BizHawk.Emulation.Common
_remaps = remaps;
}
- public ControllerDefinition Definition
- {
- get { throw new NotImplementedException(); }
- }
+ public ControllerDefinition Definition => throw new NotImplementedException();
public bool IsPressed(string button)
{
diff --git a/BizHawk.Emulation.Common/Database/Database.cs b/BizHawk.Emulation.Common/Database/Database.cs
index efdd513bb3..2b279d054b 100644
--- a/BizHawk.Emulation.Common/Database/Database.cs
+++ b/BizHawk.Emulation.Common/Database/Database.cs
@@ -31,9 +31,8 @@ namespace BizHawk.Emulation.Common
public static GameInfo CheckDatabase(string hash)
{
- CompactGameInfo cgi;
- var hashNotype = RemoveHashType(hash);
- DB.TryGetValue(hashNotype, out cgi);
+ var hashNoType = RemoveHashType(hash);
+ DB.TryGetValue(hashNoType, out var cgi);
if (cgi == null)
{
Console.WriteLine($"DB: hash {hash} not in game database.");
@@ -110,94 +109,91 @@ namespace BizHawk.Emulation.Common
public static void LoadDatabase(string path)
{
- using (var reader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
+ using var reader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
+ while (reader.EndOfStream == false)
{
- while (reader.EndOfStream == false)
+ var line = reader.ReadLine() ?? "";
+ try
{
- var line = reader.ReadLine() ?? "";
- try
+ if (line.StartsWith(";"))
{
- if (line.StartsWith(";"))
- {
- continue; // comment
- }
-
- if (line.StartsWith("#"))
- {
- LoadDatabase_Escape(line, Path.GetDirectoryName(path));
- continue;
- }
-
- if (line.Trim().Length == 0)
- {
- continue;
- }
-
- var items = line.Split('\t');
-
- var game = new CompactGameInfo
- {
- Hash = RemoveHashType(items[0].ToUpper())
- };
-
- // remove a hash type identifier. well don't really need them for indexing (they're just there for human purposes)
- switch (items[1].Trim())
- {
- case "B":
- game.Status = RomStatus.BadDump;
- break;
- case "V":
- game.Status = RomStatus.BadDump;
- break;
- case "T":
- game.Status = RomStatus.TranslatedRom;
- break;
- case "O":
- game.Status = RomStatus.Overdump;
- break;
- case "I":
- game.Status = RomStatus.Bios;
- break;
- case "D":
- game.Status = RomStatus.Homebrew;
- break;
- case "H":
- game.Status = RomStatus.Hack;
- break;
- case "U":
- game.Status = RomStatus.Unknown;
- break;
- default:
- game.Status = RomStatus.GoodDump;
- break;
- }
-
- game.Name = items[2];
- game.System = items[3];
- game.MetaData = items.Length >= 6 ? items[5] : null;
- game.Region = items.Length >= 7 ? items[6] : "";
- game.ForcedCore = items.Length >= 8 ? items[7].ToLowerInvariant() : "";
-
- if (DB.ContainsKey(game.Hash))
- {
- Console.WriteLine("gamedb: Multiple hash entries {0}, duplicate detected on \"{1}\" and \"{2}\"", game.Hash, game.Name, DB[game.Hash].Name);
- }
-
- DB[game.Hash] = game;
+ continue; // comment
}
- catch
+
+ if (line.StartsWith("#"))
{
- Console.WriteLine($"Error parsing database entry: {line}");
+ LoadDatabase_Escape(line, Path.GetDirectoryName(path));
+ continue;
}
+
+ if (line.Trim().Length == 0)
+ {
+ continue;
+ }
+
+ var items = line.Split('\t');
+
+ var game = new CompactGameInfo
+ {
+ Hash = RemoveHashType(items[0].ToUpper())
+ };
+
+ // remove a hash type identifier. well don't really need them for indexing (they're just there for human purposes)
+ switch (items[1].Trim())
+ {
+ case "B":
+ game.Status = RomStatus.BadDump;
+ break;
+ case "V":
+ game.Status = RomStatus.BadDump;
+ break;
+ case "T":
+ game.Status = RomStatus.TranslatedRom;
+ break;
+ case "O":
+ game.Status = RomStatus.Overdump;
+ break;
+ case "I":
+ game.Status = RomStatus.Bios;
+ break;
+ case "D":
+ game.Status = RomStatus.Homebrew;
+ break;
+ case "H":
+ game.Status = RomStatus.Hack;
+ break;
+ case "U":
+ game.Status = RomStatus.Unknown;
+ break;
+ default:
+ game.Status = RomStatus.GoodDump;
+ break;
+ }
+
+ game.Name = items[2];
+ game.System = items[3];
+ game.MetaData = items.Length >= 6 ? items[5] : null;
+ game.Region = items.Length >= 7 ? items[6] : "";
+ game.ForcedCore = items.Length >= 8 ? items[7].ToLowerInvariant() : "";
+
+ if (DB.ContainsKey(game.Hash))
+ {
+ Console.WriteLine("gamedb: Multiple hash entries {0}, duplicate detected on \"{1}\" and \"{2}\"", game.Hash, game.Name, DB[game.Hash].Name);
+ }
+
+ DB[game.Hash] = game;
+ }
+ catch
+ {
+ Console.WriteLine($"Error parsing database entry: {line}");
}
}
}
public static GameInfo GetGameInfo(byte[] romData, string fileName)
{
- CompactGameInfo cgi;
var hash = $"{CRC32.Calculate(romData):X8}";
- if (DB.TryGetValue(hash, out cgi))
+ if (DB.TryGetValue(hash, out var cgi))
{
return new GameInfo(cgi);
}
@@ -316,10 +312,9 @@ namespace BizHawk.Emulation.Common
case ".TAP":
byte[] head = romData.Take(8).ToArray();
- if (System.Text.Encoding.Default.GetString(head).Contains("C64-TAPE"))
- game.System = "C64";
- else
- game.System = "ZXSpectrum";
+ game.System = Encoding.Default.GetString(head).Contains("C64-TAPE")
+ ? "C64"
+ : "ZXSpectrum";
break;
case ".Z64":
diff --git a/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs b/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs
index 266106d175..c2dff4dc45 100644
--- a/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs
+++ b/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs
@@ -2,6 +2,7 @@
using System.Linq;
using System.Collections.Generic;
+// ReSharper disable StringLiteralTypo
namespace BizHawk.Emulation.Common
{
public static class FirmwareDatabase
@@ -202,10 +203,10 @@ namespace BizHawk.Emulation.Common
Option("PSX", "J", ps_30j);
Option("PSX", "E", ps_30e);
- // in general, alternates arent allowed.. their quality isnt known.
+ // in general, alternates aren't allowed.. their quality isn't known.
// we have this comment from fobby.net: "SCPH7502 works fine for European games" (TBD)
// however, we're sticking with the 3.0 series.
- // please note: 2.1 or 2.2 would be a better choice, as the dates are the same and the bioses are more likely to matching in terms of entrypoints and such.
+ // please note: 2.1 or 2.2 would be a better choice, as the dates are the same and the bioses are more likely to matching in terms of entry points and such.
// but 3.0 is what mednafen used
Option("PSX", "J", ps_10j, FirmwareOptionStatus.Unacceptable);
Option("PSX", "J", ps_11j, FirmwareOptionStatus.Unacceptable);
@@ -371,13 +372,13 @@ namespace BizHawk.Emulation.Common
public enum FirmwareOptionStatus
{
- //This is what we want you to use to get checkmarks, and for tasing
+ //This is what we want you to use to get checkmarks, and for TASing
Ideal,
//This will work with our core
Acceptable,
- //This is a good file, but it doesnt work with our core
+ //This is a good file, but it doesn't work with our core
Unacceptable,
//I know this is weird, you'd think the file is bad
diff --git a/BizHawk.Emulation.Common/EmulationExceptions.cs b/BizHawk.Emulation.Common/EmulationExceptions.cs
index 585dafc742..3b2635ed64 100644
--- a/BizHawk.Emulation.Common/EmulationExceptions.cs
+++ b/BizHawk.Emulation.Common/EmulationExceptions.cs
@@ -40,11 +40,6 @@ namespace BizHawk.Emulation.Common
: base("Core does not support CGB only games!")
{
}
-
- public CGBNotSupportedException(string message)
- : base(message)
- {
- }
}
public class SavestateSizeMismatchException : InvalidOperationException
diff --git a/BizHawk.Emulation.Common/Interfaces/IEmulator.cs b/BizHawk.Emulation.Common/Interfaces/IEmulator.cs
index 6920136d94..1f8abe0a02 100644
--- a/BizHawk.Emulation.Common/Interfaces/IEmulator.cs
+++ b/BizHawk.Emulation.Common/Interfaces/IEmulator.cs
@@ -27,14 +27,14 @@ namespace BizHawk.Emulation.Common
///
/// Runs the emulator core for 1 frame
/// note that (some?) cores expect you to call SoundProvider.GetSamples() after each FrameAdvance()
- /// please do this, even when = false
+ /// please do this, even when = false
/// The instance that the core will use for input.
/// The provided by the client must provide the buttons specified by the core through the property
///
/// Whether or not to render video, cores will pass false here in cases such as frame skipping
- /// Whether or not to render audio, cores will pass here false here in cases such as fast forwarding where bypassing sound may improve speed
+ /// Whether or not to render audio, cores will pass here false here in cases such as fast forwarding where bypassing sound may improve speed
///
- bool FrameAdvance(IController controller, bool render, bool rendersound = true);
+ bool FrameAdvance(IController controller, bool render, bool renderSound = true);
///
/// Gets the current frame count
diff --git a/BizHawk.Emulation.Common/Interfaces/Services/ICodeDataLogger.cs b/BizHawk.Emulation.Common/Interfaces/Services/ICodeDataLogger.cs
index 3e89564d9c..ec1a6003f7 100644
--- a/BizHawk.Emulation.Common/Interfaces/Services/ICodeDataLogger.cs
+++ b/BizHawk.Emulation.Common/Interfaces/Services/ICodeDataLogger.cs
@@ -51,7 +51,7 @@ namespace BizHawk.Emulation.Common
///
/// Whether the CDL is tracking a block with the given name
///
- bool Has(string blockname);
+ bool Has(string blockName);
///
/// Gets or sets a value indicating whether the status is active.
diff --git a/BizHawk.Emulation.Common/TextState.cs b/BizHawk.Emulation.Common/TextState.cs
index 6dd099d275..0b6b1b7c6b 100644
--- a/BizHawk.Emulation.Common/TextState.cs
+++ b/BizHawk.Emulation.Common/TextState.cs
@@ -83,8 +83,7 @@ namespace BizHawk.Emulation.Common
{
// works for either save or load, but as a consequence cannot report intelligent
// errors about section name mismatches
- Node next = null;
- Current.Objects.TryGetValue(name, out next);
+ Current.Objects.TryGetValue(name, out var next);
if (next == null)
{
next = new Node();
diff --git a/BizHawk.sln.DotSettings b/BizHawk.sln.DotSettings
index efa526d51a..63699ddb60 100644
--- a/BizHawk.sln.DotSettings
+++ b/BizHawk.sln.DotSettings
@@ -212,6 +212,7 @@
True
True
True
+ True
True
True
True
@@ -223,6 +224,7 @@
True
True
True
+ True
True
True
True
@@ -237,6 +239,7 @@
True
True
True
+ True
True
True
True
@@ -274,6 +277,7 @@
True
True
True
+ True
True
True
True