This commit is contained in:
Crsky
2023-08-25 09:03:13 +08:00
119 changed files with 11077 additions and 617 deletions

View File

@@ -39,7 +39,7 @@ namespace GameRes.Formats.Kaguya
[Export(typeof(ArchiveFormat))]
public class ArcOpener : ArchiveFormat
{
public override string Tag { get { return "ARI"; } }
public override string Tag { get { return "ARC/ARI"; } }
public override string Description { get { return "KaGuYa script engine resource archive"; } }
public override uint Signature { get { return 0x314c4657; } } // 'WFL1'
public override bool IsHierarchic { get { return true; } }
@@ -48,11 +48,12 @@ namespace GameRes.Formats.Kaguya
public ArcOpener ()
{
Extensions = new string[] { "arc" };
ContainedFormats = new[] { "AP", "APS3", "OGG", "DAT/GENERIC" };
}
public override ArcFile TryOpen (ArcView file)
{
var reader = new IndexReader();
var reader = new IndexReader (this);
var dir = reader.ReadIndex (file);
if (null == dir || 0 == dir.Count)
return null;
@@ -77,9 +78,15 @@ namespace GameRes.Formats.Kaguya
internal class IndexReader
{
ArchiveFormat m_format;
byte[] m_name_buf = new byte[0x20];
List<Entry> m_dir = new List<Entry>();
public IndexReader (ArchiveFormat format)
{
m_format = format;
}
public List<Entry> ReadIndex (ArcView file)
{
string ari_name = Path.ChangeExtension (file.Name, "ari");
@@ -163,7 +170,7 @@ namespace GameRes.Formats.Kaguya
else if (1 == entry.Mode)
entry.Type = "image";
else
entry.Type = FormatCatalog.Instance.GetTypeFromName (entry.Name);
entry.Type = FormatCatalog.Instance.GetTypeFromName (entry.Name, m_format.ContainedFormats);
}
string ReadName (ArcView file, long offset, int name_len)
@@ -246,4 +253,9 @@ namespace GameRes.Formats.Kaguya
}
#endregion
}
[Export(typeof(ResourceAlias))]
[ExportMetadata("Extension", "TBL")]
[ExportMetadata("Target", "DAT/GENERIC")]
public class TblFormat : ResourceAlias { }
}

View File

@@ -228,8 +228,7 @@ namespace GameRes.Formats.Kaguya
public virtual LinkEncryption GetEncryption ()
{
var params_dir = VFS.GetDirectoryName (m_input.Name);
var params_dat = VFS.CombinePath (params_dir, "params.dat");
var params_dat = VFS.ChangeFileName (m_input.Name, "params.dat");
if (!VFS.FileExists (params_dat))
return null;
@@ -555,8 +554,10 @@ namespace GameRes.Formats.Kaguya
m_input.Position = start;
SkipChunk();
m_title = ReadString();
if (m_version.Major < 3)
if (m_version.Major < 2)
m_input.ReadCString();
// else
// SkipString();
SkipString();
SkipString();
m_input.ReadByte();
@@ -583,7 +584,7 @@ namespace GameRes.Formats.Kaguya
{
ReadHeader (0x17);
if ("幼なじみと甘~くエッチに過ごす方法" == m_title)
if ("幼なじみと甘~くエッチに過ごす方法" == m_title || "艶女医" == m_title)
{
int count = m_input.ReadUInt8();
for (int i = 0; i < count; ++i)
@@ -595,8 +596,15 @@ namespace GameRes.Formats.Kaguya
}
SkipArray();
SkipArray();
m_input.ReadInt32();
return m_input.ReadBytes (240000);
if ("幼なじみと甘~くエッチに過ごす方法" == m_title)
{
m_input.ReadInt32();
return m_input.ReadBytes (240000);
}
else
{
return ReadKey();
}
}
else // 毎日がM!
{