implemented 'tskforce' archives.

This commit is contained in:
morkt 2016-10-25 02:12:26 +04:00
parent f9eb77d0a4
commit 27dbb52b89
3 changed files with 84 additions and 0 deletions

View File

@ -301,6 +301,7 @@
<Compile Include="TamaSoft\AudioESD.cs" /> <Compile Include="TamaSoft\AudioESD.cs" />
<Compile Include="TamaSoft\ImageBTN.cs" /> <Compile Include="TamaSoft\ImageBTN.cs" />
<Compile Include="TamaSoft\ImageSUR.cs" /> <Compile Include="TamaSoft\ImageSUR.cs" />
<Compile Include="Taskforce\ArcDAT.cs" />
<Compile Include="TechnoBrain\ImageIPH.cs" /> <Compile Include="TechnoBrain\ImageIPH.cs" />
<Compile Include="DxLib\ArcDX.cs" /> <Compile Include="DxLib\ArcDX.cs" />
<Compile Include="ArcMiris.cs" /> <Compile Include="ArcMiris.cs" />

View File

@ -0,0 +1,78 @@
//! \file ArcDAT.cs
//! \date Tue Oct 25 01:48:10 2016
//! \brief Taskforce resource archive.
//
// Copyright (C) 2016 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using GameRes.Compression;
namespace GameRes.Formats.Taskforce
{
[Export(typeof(ArchiveFormat))]
public class DatOpener : ArchiveFormat
{
public override string Tag { get { return "DAT/TASKFORCE"; } }
public override string Description { get { return "Taskforce engine resource archive"; } }
public override uint Signature { get { return 0x666B7374; } } // 'tskf'
public override bool IsHierarchic { get { return true; } }
public override bool CanWrite { get { return false; } }
public override ArcFile TryOpen (ArcView file)
{
if (!file.View.AsciiEqual (4, "orce"))
return null;
int count = file.View.ReadInt32 (8);
if (!IsSaneCount (count))
return null;
uint index_offset = 0xC;
var dir = new List<Entry> (count);
for (int i = 0; i < count; ++i)
{
var name = file.View.ReadString (index_offset, 0x100);
var entry = FormatCatalog.Instance.Create<PackedEntry> (name);
index_offset += 0x100;
entry.Offset = file.View.ReadUInt32 (index_offset);
entry.UnpackedSize = file.View.ReadUInt32 (index_offset+4);
entry.Size = file.View.ReadUInt32 (index_offset+8);
if (!entry.CheckPlacement (file.MaxOffset))
return null;
entry.IsPacked = entry.UnpackedSize != entry.Size;
dir.Add (entry);
index_offset += 0xC;
}
return new ArcFile (file, this, dir);
}
public override Stream OpenEntry (ArcFile arc, Entry entry)
{
var input = base.OpenEntry (arc, entry);
var pent = entry as PackedEntry;
if (null == pent || !pent.IsPacked)
return input;
return new LzssStream (input);
}
}
}

View File

@ -576,6 +576,7 @@ Medorei ~Okasareta Houkago~<br/>
Onna Kyoushi<br/> Onna Kyoushi<br/>
Ore to Kanojo wa Shuju na Kankei<br/> Ore to Kanojo wa Shuju na Kankei<br/>
Saishuu Chikan Densha<br/> Saishuu Chikan Densha<br/>
Saishuu Chikan Densha 2<br/>
Saishuu Chikan Densha 3<br/> Saishuu Chikan Densha 3<br/>
Serina<br/> Serina<br/>
Ura Nyuugaku ~Ineki ni Nureta Kyoukasho~<br/> Ura Nyuugaku ~Ineki ni Nureta Kyoukasho~<br/>
@ -1216,10 +1217,14 @@ Tiara<br/>
Tsumi no Hikari Rendezvous<br/> Tsumi no Hikari Rendezvous<br/>
</td></tr> </td></tr>
<tr class="odd"><td>arc.dat</td><td>-</td><td>No</td><td rowspan="2">AdvSys3</td><td rowspan="2"> <tr class="odd"><td>arc.dat</td><td>-</td><td>No</td><td rowspan="2">AdvSys3</td><td rowspan="2">
Jii Tousaku<br/>
Okami Tsuma ~Ryokan Baito de no Himitsu~<br/> Okami Tsuma ~Ryokan Baito de no Himitsu~<br/>
Tain Shoukougun<br/> Tain Shoukougun<br/>
</td></tr> </td></tr>
<tr class="odd last"><td>*.gwd</td><td><tt>GWD</tt></td><td>No</td></tr> <tr class="odd last"><td>*.gwd</td><td><tt>GWD</tt></td><td>No</td></tr>
<tr><td>*.dat</td><td><tt>tskforce</tt></td><td>No</td><td>Taskforce</td><td>
Musumaker<br/>
</td></tr>
</table> </table>
<p><a name="note-1" class="footnote">1</a> Non-encrypted only</p> <p><a name="note-1" class="footnote">1</a> Non-encrypted only</p>
</body> </body>