diff --git a/BizHawk.Client.Common/Properties/AssemblyInfo.cs b/BizHawk.Client.Common/Properties/AssemblyInfo.cs index 6fe9a22893..6a043c7bc2 100644 --- a/BizHawk.Client.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Client.Common/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs b/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs index 085b59e766..d3c12a6be3 100644 --- a/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs +++ b/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Client.EmuHawk/BizBox.cs b/BizHawk.Client.EmuHawk/BizBox.cs index 5f5276a76e..5cd57dc90c 100644 --- a/BizHawk.Client.EmuHawk/BizBox.cs +++ b/BizHawk.Client.EmuHawk/BizBox.cs @@ -26,7 +26,7 @@ namespace BizHawk.Client.EmuHawk private void BizBox_Load(object sender, EventArgs e) { - string mainversion = VersionInfo.MAINVERSION; + string mainversion = VersionInfo.Mainversion; if (IntPtr.Size == 8) mainversion += " (x64)"; if (VersionInfo.DeveloperBuild) diff --git a/BizHawk.Client.EmuHawk/Properties/AssemblyInfo.cs b/BizHawk.Client.EmuHawk/Properties/AssemblyInfo.cs index e544a01ef3..e317ccb818 100644 --- a/BizHawk.Client.EmuHawk/Properties/AssemblyInfo.cs +++ b/BizHawk.Client.EmuHawk/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Client.EmuHawk/UpdateChecker.cs b/BizHawk.Client.EmuHawk/UpdateChecker.cs index 6b61290213..2b114ee4b8 100644 --- a/BizHawk.Client.EmuHawk/UpdateChecker.cs +++ b/BizHawk.Client.EmuHawk/UpdateChecker.cs @@ -53,8 +53,8 @@ namespace BizHawk.Client.EmuHawk { return AutoCheckEnabled && LatestVersion != IgnoreVersion && - ParseVersion(VersionInfo.MAINVERSION) != 0 && // Avoid notifying if current version string is invalid - ParseVersion(LatestVersion) > ParseVersion(VersionInfo.MAINVERSION); + ParseVersion(VersionInfo.Mainversion) != 0 && // Avoid notifying if current version string is invalid + ParseVersion(LatestVersion) > ParseVersion(VersionInfo.Mainversion); } } diff --git a/BizHawk.Common/Properties/AssemblyInfo.cs b/BizHawk.Common/Properties/AssemblyInfo.cs index 6fc72f8f0e..dc26c045bd 100644 --- a/BizHawk.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Common/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Emulation.Common/BizInvoke/BizInvoker.cs b/BizHawk.Emulation.Common/BizInvoke/BizInvoker.cs index 25054d8e96..e88e1ca446 100644 --- a/BizHawk.Emulation.Common/BizInvoke/BizInvoker.cs +++ b/BizHawk.Emulation.Common/BizInvoke/BizInvoker.cs @@ -311,14 +311,22 @@ namespace BizHawk.Emulation.Common.BizInvoke var nativeParamTypes = new List(); var returnType = baseMethod.ReturnType; if (returnType != typeof(void) && !returnType.IsPrimitive) + { throw new InvalidOperationException("Only primitive return types are supported"); + } // define a field on the type to hold the entry pointer - var field = type.DefineField("EntryPtrField" + baseMethod.Name, typeof(IntPtr), + var field = type.DefineField( + "EntryPtrField" + baseMethod.Name, + typeof(IntPtr), FieldAttributes.Public); - var method = type.DefineMethod(baseMethod.Name, MethodAttributes.Virtual | MethodAttributes.Public, - CallingConventions.HasThis, returnType, paramTypes); + var method = type.DefineMethod( + baseMethod.Name, + MethodAttributes.Virtual | MethodAttributes.Public, + CallingConventions.HasThis, + returnType, + paramTypes); var il = method.GetILGenerator(); diff --git a/BizHawk.Emulation.Common/Database/Database.cs b/BizHawk.Emulation.Common/Database/Database.cs index 774f275a55..65de2f94a1 100644 --- a/BizHawk.Emulation.Common/Database/Database.cs +++ b/BizHawk.Emulation.Common/Database/Database.cs @@ -8,17 +8,6 @@ using BizHawk.Common.BufferExtensions; namespace BizHawk.Emulation.Common { - public class CompactGameInfo - { - public string Name { get; set; } - public string System { get; set; } - public string MetaData { get; set; } - public string Hash { get; set; } - public string Region { get; set; } - public RomStatus Status { get; set; } - public string ForcedCore { get; set; } - } - public static class Database { private static readonly Dictionary DB = new Dictionary(); @@ -42,8 +31,8 @@ namespace BizHawk.Emulation.Common public static GameInfo CheckDatabase(string hash) { CompactGameInfo cgi; - var hash_notype = RemoveHashType(hash); - DB.TryGetValue(hash_notype, out cgi); + var hashNotype = RemoveHashType(hash); + DB.TryGetValue(hashNotype, out cgi); if (cgi == null) { Console.WriteLine("DB: hash " + hash + " not in game database."); @@ -237,7 +226,7 @@ namespace BizHawk.Emulation.Common CRC32.Calculate(romData), System.Security.Cryptography.MD5.Create().ComputeHash(romData).BytesToHexString()); - var ext = Path.GetExtension(fileName).ToUpperInvariant(); + var ext = Path.GetExtension(fileName)?.ToUpperInvariant(); switch (ext) { @@ -344,10 +333,10 @@ namespace BizHawk.Emulation.Common break; } - game.Name = Path.GetFileNameWithoutExtension(fileName).Replace('_', ' '); + game.Name = Path.GetFileNameWithoutExtension(fileName)?.Replace('_', ' '); // If filename is all-caps, then attempt to proper-case the title. - if (game.Name == game.Name.ToUpperInvariant()) + if (!string.IsNullOrWhiteSpace(game.Name) && game.Name == game.Name.ToUpperInvariant()) { game.Name = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(game.Name.ToLower()); } @@ -355,4 +344,15 @@ namespace BizHawk.Emulation.Common return game; } } + + public class CompactGameInfo + { + public string Name { get; set; } + public string System { get; set; } + public string MetaData { get; set; } + public string Hash { get; set; } + public string Region { get; set; } + public RomStatus Status { get; set; } + public string ForcedCore { get; set; } + } } diff --git a/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs b/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs index c297b8c175..8309cbbdb6 100644 --- a/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs +++ b/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs @@ -53,8 +53,8 @@ namespace BizHawk.Emulation.Common // 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? + 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? Firmware("SAT", "J", "Bios (J)"); Option("SAT", "J", ss_100_j); Option("SAT", "J", ss_101_j); @@ -113,8 +113,8 @@ namespace BizHawk.Emulation.Common // SMS var sms_us_13 = File("C315672807D8DDB8D91443729405C766DD95CAE7", 8192, "sms_us_1.3.sms", "SMS BIOS 1.3 (USA, Europe)"); var sms_jp_21 = File("A8C1B39A2E41137835EDA6A5DE6D46DD9FADBAF2", 8192, "sms_jp_2.1.sms", "SMS BIOS 2.1 (Japan)"); - var sms_us_1b = File("29091FF60EF4C22B1EE17AA21E0E75BAC6B36474", 8192, "sms_us_1.0b.sms", "SMS BIOS 1.0 (USA) (Proto)"); //?? is this size correct? - var sms_m404 = File("4A06C8E66261611DCE0305217C42138B71331701", 8192, "sms_m404.sms", "SMS BIOS (USA) (M404) (Proto)"); //?? is this size correct? + var sms_us_1b = File("29091FF60EF4C22B1EE17AA21E0E75BAC6B36474", 8192, "sms_us_1.0b.sms", "SMS BIOS 1.0 (USA) (Proto)"); // ?? is this size correct? + var sms_m404 = File("4A06C8E66261611DCE0305217C42138B71331701", 8192, "sms_m404.sms", "SMS BIOS (USA) (M404) (Proto)"); // ?? is this size correct? Firmware("SMS", "Export", "SMS Bios (USA/Export)"); Firmware("SMS", "Japan", "SMS Bios (Japan)"); diff --git a/BizHawk.Emulation.Common/Extensions.cs b/BizHawk.Emulation.Common/Extensions.cs index d9c2823032..fd839d334e 100644 --- a/BizHawk.Emulation.Common/Extensions.cs +++ b/BizHawk.Emulation.Common/Extensions.cs @@ -341,7 +341,7 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions // If async is not provided by the implementation this method will throw an exception // We need to figure out a reliable way to check specifically for a NotImplementedException, then maybe this method will be more useful // If a method is not marked but all it does is throw an exception, consider it not implemented - //return !info.ThrowsError(); + ////return !info.ThrowsError(); return true; } diff --git a/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs b/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs index aa3ee8415d..454bd38dfc 100644 --- a/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs b/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs index df8554c494..b11a364526 100644 --- a/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs b/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs index bd0b20f81e..0d006d4b8c 100644 --- a/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.MAINVERSION + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)]