RomLoader - simplify

This commit is contained in:
adelikat 2020-05-16 14:43:50 -05:00
parent 8da52d985b
commit 3808a6d88f
1 changed files with 21 additions and 35 deletions

View File

@ -382,10 +382,8 @@ namespace BizHawk.Client.Common
discNames.Add(discName); discNames.Add(discName);
discs.Add(disc); discs.Add(disc);
var discType = new DiscIdentifier(disc).DetectDiscType();
sw.WriteLine("{0}", Path.GetFileName(e.Path)); sw.WriteLine("{0}", Path.GetFileName(e.Path));
if (discType == DiscType.SonyPSX)
{
string discHash = new DiscHasher(disc).Calculate_PSX_BizIDHash().ToString("X8"); string discHash = new DiscHasher(disc).Calculate_PSX_BizIDHash().ToString("X8");
game = Database.CheckDatabase(discHash); game = Database.CheckDatabase(discHash);
if (game == null || game.IsRomStatusBad() || game.Status == RomStatus.NotInDatabase) if (game == null || game.IsRomStatusBad() || game.Status == RomStatus.NotInDatabase)
@ -400,11 +398,6 @@ namespace BizHawk.Client.Common
sw.WriteLine("The file you loaded hasn't been hashed entirely (it would take too long)"); sw.WriteLine("The file you loaded hasn't been hashed entirely (it would take too long)");
sw.WriteLine("Compare it with the full hash calculated by the PSX menu's Hash Discs tool"); sw.WriteLine("Compare it with the full hash calculated by the PSX menu's Hash Discs tool");
} }
}
else
{
sw.WriteLine("Not a PSX disc");
}
sw.WriteLine("-------------------------"); sw.WriteLine("-------------------------");
} }
@ -689,10 +682,8 @@ namespace BizHawk.Client.Common
discNames.Add(discName); discNames.Add(discName);
discs.Add(disc); discs.Add(disc);
var discType = new DiscIdentifier(disc).DetectDiscType();
sw.WriteLine("{0}", Path.GetFileName(e)); sw.WriteLine("{0}", Path.GetFileName(e));
if (discType == DiscType.SonyPSX)
{
string discHash = new DiscHasher(disc).Calculate_PSX_BizIDHash().ToString("X8"); string discHash = new DiscHasher(disc).Calculate_PSX_BizIDHash().ToString("X8");
game = Database.CheckDatabase(discHash); game = Database.CheckDatabase(discHash);
if (game == null || game.IsRomStatusBad() || game.Status == RomStatus.NotInDatabase) if (game == null || game.IsRomStatusBad() || game.Status == RomStatus.NotInDatabase)
@ -707,11 +698,6 @@ namespace BizHawk.Client.Common
sw.WriteLine("The file you loaded hasn't been hashed entirely (it would take too long)"); sw.WriteLine("The file you loaded hasn't been hashed entirely (it would take too long)");
sw.WriteLine("Compare it with the full hash calculated by the PSX menu's Hash Discs tool"); sw.WriteLine("Compare it with the full hash calculated by the PSX menu's Hash Discs tool");
} }
}
else
{
sw.WriteLine("Not a PSX disc");
}
sw.WriteLine("-------------------------"); sw.WriteLine("-------------------------");
} }