From 4b0506c9d0d9870af247fa12be1cf792a3c2c8ac Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 14 Aug 2017 15:04:25 +0400 Subject: [PATCH] (YPF): lookup game by executable name. --- ArcFormats/YuRis/ArcYPF.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ArcFormats/YuRis/ArcYPF.cs b/ArcFormats/YuRis/ArcYPF.cs index 24316612..781fc693 100644 --- a/ArcFormats/YuRis/ArcYPF.cs +++ b/ArcFormats/YuRis/ArcYPF.cs @@ -123,7 +123,7 @@ namespace GameRes.Formats.YuRis return null; var parser = new Parser (file, version, count, dir_size); - var scheme = QueryEncryptionScheme (version); + var scheme = QueryEncryptionScheme (file.Name, version); var dir = parser.ScanDir (scheme); if (null == dir || 0 == dir.Count) return null; @@ -175,10 +175,13 @@ namespace GameRes.Formats.YuRis return new GUI.CreateYPFWidget(); } - YpfScheme QueryEncryptionScheme (uint version) + YpfScheme QueryEncryptionScheme (string arc_name, uint version) { - var options = Query (arcStrings.YPFNotice); + var title = FormatCatalog.Instance.LookupGame (arc_name); YpfScheme scheme; + if (!string.IsNullOrEmpty (title) && KnownSchemes.TryGetValue (title, out scheme)) + return scheme; + var options = Query (arcStrings.YPFNotice); if (!KnownSchemes.TryGetValue (options.Scheme, out scheme) || null == scheme) scheme = new YpfScheme { SwapTable = GuessSwapTable (version), @@ -354,7 +357,7 @@ namespace GameRes.Formats.YuRis uint* header = (uint*)raw; uint version = header[1]; int first_item, last_item; - if (version >= 0x1CE || 0x12C == version) + if (version >= 0x1CE || 0x12C == version || 0x19A == version) { first_item = 3; last_item = 7;