implement a simple sega saturn cd heuristic detection. unknown cues once again are loaded into PCECD

This commit is contained in:
goyuken 2013-05-01 17:06:36 +00:00
parent 0f5cc4ed25
commit 2631ffbde6
2 changed files with 22 additions and 8 deletions

View File

@ -116,7 +116,6 @@ namespace BizHawk.DiscSystem
}
}
/// <summary>
/// Returns a SectorEntry from which you can retrieve various interesting pieces of information about the sector.
/// The SectorEntry's interface is not likely to be stable, though, but it may be more convenient.
@ -206,5 +205,19 @@ namespace BizHawk.DiscSystem
}
return "no data track found";
}
/// <summary>
/// this isn't quite right...
/// </summary>
/// <returns></returns>
public bool DetectSegaSaturn()
{
byte[] data = new byte[2048];
ReadLBA_2048(0, data, 0);
byte[] cmp = System.Text.Encoding.ASCII.GetBytes("SEGA SEGASATURN");
byte[] cmp2 = new byte[15];
Buffer.BlockCopy(data, 0, cmp2, 0, 15);
return System.Linq.Enumerable.SequenceEqual(cmp, cmp2);
}
}
}

View File

@ -1626,6 +1626,8 @@ namespace BizHawk.MultiClient
case "Coleco": str += "ColecoVision"; break;
case "GBA": str += "Game Boy Advance"; break;
case "N64": str += "Nintendo 64"; break;
case "SAT": str += "Saturn"; break;
case "DGB": str += "Game Boy Link"; break;
}
if (INTERIM) str += " (interim)";
@ -1932,17 +1934,16 @@ namespace BizHawk.MultiClient
if (Emulation.Consoles.PSX.Octoshock.CheckIsPSX(disc))
{
game = new GameInfo {System = "PSX", Name = Path.GetFileNameWithoutExtension(file.Name), Hash = hash};
game = new GameInfo { System = "PSX", Name = Path.GetFileNameWithoutExtension(file.Name), Hash = hash };
disc.Dispose();
}
/*
else if (disc.DetectSegaSaturn())
{
game = new GameInfo { System = "SAT", Name = Path.GetFileNameWithoutExtension(file.Name), Hash = hash };
}
else
{
game = new GameInfo {System = "PCECD", Name = Path.GetFileNameWithoutExtension(file.Name), Hash = hash};
}*/
else
{
game = new GameInfo {System = "SAT", Name = Path.GetFileNameWithoutExtension(file.Name), Hash = hash};
game = new GameInfo { System = "PCECD", Name = Path.GetFileNameWithoutExtension(file.Name), Hash = hash };
}
}