Wire up known bad/good rom status from GameDB
This commit is contained in:
parent
74c8e09892
commit
6fc8d16e42
|
@ -6,17 +6,29 @@ using System.Threading;
|
||||||
|
|
||||||
namespace BizHawk
|
namespace BizHawk
|
||||||
{
|
{
|
||||||
|
public enum RomStatus
|
||||||
|
{
|
||||||
|
GoodDump,
|
||||||
|
BadDump,
|
||||||
|
Homebrew,
|
||||||
|
TranslatedRom,
|
||||||
|
BIOS,
|
||||||
|
Overdump,
|
||||||
|
NotInDatabase
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum HashType
|
||||||
|
{
|
||||||
|
CRC32, MD5
|
||||||
|
}
|
||||||
|
|
||||||
public class GameInfo
|
public class GameInfo
|
||||||
{
|
{
|
||||||
public string Name;
|
public string Name;
|
||||||
public string System;
|
public string System;
|
||||||
public string MetaData;
|
public string MetaData;
|
||||||
public string hash;
|
public string hash;
|
||||||
|
public RomStatus Status;
|
||||||
public enum HashType
|
|
||||||
{
|
|
||||||
CRC32, MD5
|
|
||||||
}
|
|
||||||
|
|
||||||
public string[] GetOptions()
|
public string[] GetOptions()
|
||||||
{
|
{
|
||||||
|
@ -93,6 +105,17 @@ namespace BizHawk
|
||||||
var Game = new GameInfo();
|
var Game = new GameInfo();
|
||||||
//remove a hash type identifier. well don't really need them for indexing (theyre just there for human purposes)
|
//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());
|
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.Name = items[2];
|
||||||
Game.System = items[3];
|
Game.System = items[3];
|
||||||
Game.MetaData = items.Length >= 6 ? items[5] : null;
|
Game.MetaData = items.Length >= 6 ? items[5] : null;
|
||||||
|
@ -124,6 +147,7 @@ namespace BizHawk
|
||||||
var Game = new GameInfo();
|
var Game = new GameInfo();
|
||||||
Game.hash = hash;
|
Game.hash = hash;
|
||||||
Game.MetaData = "NotInDatabase";
|
Game.MetaData = "NotInDatabase";
|
||||||
|
Game.Status = RomStatus.NotInDatabase;
|
||||||
Console.WriteLine("Game was not in DB. CRC: {0:X8} ", CRC32.Calculate(RomData));
|
Console.WriteLine("Game was not in DB. CRC: {0:X8} ", CRC32.Calculate(RomData));
|
||||||
|
|
||||||
string ext = Path.GetExtension(fileName).ToUpperInvariant();
|
string ext = Path.GetExtension(fileName).ToUpperInvariant();
|
||||||
|
|
|
@ -930,11 +930,14 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
if (Global.Game != null)
|
if (Global.Game != null)
|
||||||
{
|
{
|
||||||
//TODO: check ROM dump and display warning icon
|
if (Global.Game.Status == RomStatus.BadDump)
|
||||||
//DumpError.Image = BizHawk.MultiClient.Properties.Resources.WarningHS;
|
{
|
||||||
//DumpError.ToolTipText = "Warning: Bad ROM Dump";
|
DumpError.Image = BizHawk.MultiClient.Properties.Resources.WarningHS;
|
||||||
DumpError.Image = BizHawk.MultiClient.Properties.Resources.GreenCheck;
|
DumpError.ToolTipText = "Warning: Bad ROM Dump";
|
||||||
DumpError.ToolTipText = "Verified good dump";
|
} else {
|
||||||
|
DumpError.Image = BizHawk.MultiClient.Properties.Resources.GreenCheck;
|
||||||
|
DumpError.ToolTipText = "Verified good dump";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@ namespace BizHawk.MultiClient
|
||||||
public byte[] RomData;
|
public byte[] RomData;
|
||||||
public byte[] FileData;
|
public byte[] FileData;
|
||||||
public string System;
|
public string System;
|
||||||
|
public RomStatus Status { get; private set; }
|
||||||
|
|
||||||
private string name;
|
private string name;
|
||||||
private string filesystemSafeName;
|
private string filesystemSafeName;
|
||||||
|
@ -40,6 +41,7 @@ namespace BizHawk.MultiClient
|
||||||
var info = Database.GetGameInfo(RomData, file.Name);
|
var info = Database.GetGameInfo(RomData, file.Name);
|
||||||
name = info.Name;
|
name = info.Name;
|
||||||
System = info.System;
|
System = info.System;
|
||||||
|
Status = info.Status;
|
||||||
options = new List<string>(info.GetOptions());
|
options = new List<string>(info.GetOptions());
|
||||||
CheckForPatchOptions();
|
CheckForPatchOptions();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue