diff --git a/BizHawk.Emulation/Database/Database.cs b/BizHawk.Emulation/Database/Database.cs index cb4e86ee34..c66c8ff5f0 100644 --- a/BizHawk.Emulation/Database/Database.cs +++ b/BizHawk.Emulation/Database/Database.cs @@ -6,17 +6,29 @@ using System.Threading; namespace BizHawk { + public enum RomStatus + { + GoodDump, + BadDump, + Homebrew, + TranslatedRom, + BIOS, + Overdump, + NotInDatabase + } + + public enum HashType + { + CRC32, MD5 + } + public class GameInfo { public string Name; public string System; public string MetaData; public string hash; - - public enum HashType - { - CRC32, MD5 - } + public RomStatus Status; public string[] GetOptions() { @@ -93,6 +105,17 @@ namespace BizHawk var Game = new GameInfo(); //remove a hash type identifier. well don't really need them for indexing (theyre just there for human purposes) Game.hash = RemoveHashType(items[0].ToUpper()); + 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.Homebrew; break; + default: Game.Status = RomStatus.GoodDump; break; + } Game.Name = items[2]; Game.System = items[3]; Game.MetaData = items.Length >= 6 ? items[5] : null; @@ -124,6 +147,7 @@ namespace BizHawk var Game = new GameInfo(); Game.hash = hash; Game.MetaData = "NotInDatabase"; + Game.Status = RomStatus.NotInDatabase; Console.WriteLine("Game was not in DB. CRC: {0:X8} ", CRC32.Calculate(RomData)); string ext = Path.GetExtension(fileName).ToUpperInvariant(); diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index a65919c43f..bac17583be 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -930,11 +930,14 @@ namespace BizHawk.MultiClient { if (Global.Game != null) { - //TODO: check ROM dump and display warning icon - //DumpError.Image = BizHawk.MultiClient.Properties.Resources.WarningHS; - //DumpError.ToolTipText = "Warning: Bad ROM Dump"; - DumpError.Image = BizHawk.MultiClient.Properties.Resources.GreenCheck; - DumpError.ToolTipText = "Verified good dump"; + if (Global.Game.Status == RomStatus.BadDump) + { + DumpError.Image = BizHawk.MultiClient.Properties.Resources.WarningHS; + DumpError.ToolTipText = "Warning: Bad ROM Dump"; + } else { + DumpError.Image = BizHawk.MultiClient.Properties.Resources.GreenCheck; + DumpError.ToolTipText = "Verified good dump"; + } } else { diff --git a/BizHawk.MultiClient/RomGame.cs b/BizHawk.MultiClient/RomGame.cs index f1d04e9870..8700bd0561 100644 --- a/BizHawk.MultiClient/RomGame.cs +++ b/BizHawk.MultiClient/RomGame.cs @@ -10,6 +10,7 @@ namespace BizHawk.MultiClient public byte[] RomData; public byte[] FileData; public string System; + public RomStatus Status { get; private set; } private string name; private string filesystemSafeName; @@ -40,6 +41,7 @@ namespace BizHawk.MultiClient var info = Database.GetGameInfo(RomData, file.Name); name = info.Name; System = info.System; + Status = info.Status; options = new List(info.GetOptions()); CheckForPatchOptions();