From 2631ffbde67a22df770133eb613e193d29e9a149 Mon Sep 17 00:00:00 2001 From: goyuken Date: Wed, 1 May 2013 17:06:36 +0000 Subject: [PATCH] implement a simple sega saturn cd heuristic detection. unknown cues once again are loaded into PCECD --- BizHawk.Emulation/DiscSystem/Disc.API.cs | 15 ++++++++++++++- BizHawk.MultiClient/MainForm.cs | 15 ++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/BizHawk.Emulation/DiscSystem/Disc.API.cs b/BizHawk.Emulation/DiscSystem/Disc.API.cs index fa09b44d01..0df4081f9b 100644 --- a/BizHawk.Emulation/DiscSystem/Disc.API.cs +++ b/BizHawk.Emulation/DiscSystem/Disc.API.cs @@ -116,7 +116,6 @@ namespace BizHawk.DiscSystem } } - /// /// 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"; } + + /// + /// this isn't quite right... + /// + /// + 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); + } } } \ No newline at end of file diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 6e1b337990..59ae692a7e 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -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 }; } }