ArcFormats: Support split ALF APPEND archive

* Tested game: https://vndb.org/r89951

Signed-off-by: MkfsSion <mkfssion@mkfssion.com>
This commit is contained in:
MkfsSion 2024-09-06 23:18:11 +08:00
parent 7bd244e228
commit ca196d8286

View File

@ -30,6 +30,7 @@ using System.IO;
using GameRes.Compression;
using System.Text;
using System.Linq;
using System.Text.RegularExpressions;
namespace GameRes.Formats.Eushully
{
@ -64,12 +65,21 @@ namespace GameRes.Formats.Eushully
return null;
}
static internal string GetAAIName(string alf_name)
{
const string pattern = @"^(APPEND(?:[0-9]+)?)(?:_[0-9]+)?\.ALF$";
var match = Regex.Match(alf_name, pattern);
if (match.Success)
return match.Groups[1].Value;
return alf_name;
}
internal IEnumerable<string> GetIndexNames (string alf_name)
{
yield return "sys5ini.bin";
yield return "sys4ini.bin";
yield return "sys3ini.bin";
yield return Path.ChangeExtension (alf_name, "AAI");
yield return Path.ChangeExtension (GetAAIName(alf_name), "AAI");
}
Tuple<string, Dictionary<string, List<Entry>>> LastAccessedIndex;