mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-26 23:24:00 +08:00
fix: PS2 BIP Compress
This commit is contained in:
parent
eb60e27378
commit
200a05db81
@ -42,12 +42,12 @@ namespace GameRes.Formats.Cri
|
|||||||
|
|
||||||
public SpcOpener ()
|
public SpcOpener ()
|
||||||
{
|
{
|
||||||
Extensions = new string[] { "spc" };
|
Extensions = new string[] { "spc", "bip" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ArcFile TryOpen (ArcView file)
|
public override ArcFile TryOpen (ArcView file)
|
||||||
{
|
{
|
||||||
if (!file.Name.HasExtension (".spc"))
|
if (!file.Name.HasExtension (".spc") && !file.Name.HasExtension(".bip"))
|
||||||
return null;
|
return null;
|
||||||
uint unpacked_size = file.View.ReadUInt32 (0);
|
uint unpacked_size = file.View.ReadUInt32 (0);
|
||||||
if (unpacked_size <= 0x20 || unpacked_size > 0x5000000)
|
if (unpacked_size <= 0x20 || unpacked_size > 0x5000000)
|
||||||
|
@ -28,24 +28,27 @@ namespace GameRes.Formats.Kid
|
|||||||
}
|
}
|
||||||
|
|
||||||
file.Seek(0x14, SeekOrigin.Begin);
|
file.Seek(0x14, SeekOrigin.Begin);
|
||||||
if (file.ReadUInt16() != 256)
|
if ((file.ReadUInt16() & 0x7FFF) != 256)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
uint sign = file.ReadUInt16();
|
uint sign = file.ReadUInt16();
|
||||||
uint dy;
|
uint dy;
|
||||||
bool sliced = true;
|
bool sliced = true;
|
||||||
if (sign == 0x17)
|
if (sign == 0x17 || sign == 0x19 || sign == 0x1F || sign == 0x25 || sign == 0x2E || sign == 0x34)
|
||||||
{
|
{
|
||||||
|
//sign = focusT / 2
|
||||||
dy = 16;
|
dy = 16;
|
||||||
}
|
}
|
||||||
else if (sign == 0x13)
|
else if (sign == 0x13)
|
||||||
{
|
{
|
||||||
|
//sign = focusT / 2
|
||||||
dy = 16;
|
dy = 16;
|
||||||
sliced = false;
|
sliced = false;
|
||||||
}
|
}
|
||||||
else if (sign == 0x16)
|
else if (sign == 0x16 || sign == 0x20 || sign == 0x2A)
|
||||||
{
|
{
|
||||||
|
//sign = focusT * 2
|
||||||
dy = 32;
|
dy = 32;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -57,13 +60,16 @@ namespace GameRes.Formats.Kid
|
|||||||
file.Seek(0x88, SeekOrigin.Begin);
|
file.Seek(0x88, SeekOrigin.Begin);
|
||||||
uint width = file.ReadUInt16();
|
uint width = file.ReadUInt16();
|
||||||
uint height = file.ReadUInt16();
|
uint height = file.ReadUInt16();
|
||||||
if (width >= 1280 || height >= 1280 || width == 0 || height == 0) // suppose not so large
|
if (width > 2560 || height > 1440 || width < 16 || height < 16) // suppose not so large
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
file.Seek(0x90, SeekOrigin.Begin);
|
file.Seek(0x90, SeekOrigin.Begin);
|
||||||
uint size = file.ReadUInt32();
|
//uint size = file.ReadUInt32(); // not size
|
||||||
size &= 0x00FFFFFF;
|
uint sizesign = file.ReadUInt16();
|
||||||
if (sign == 0x13 && size != (file.Length - 0x100) || sign == 0x17 && size != (file.Length - 0x100)* 2)
|
uint sizesign_high = file.ReadUInt16();
|
||||||
|
//size &= 0x00FFFFFF;
|
||||||
|
//if (sign == 0x13 && size != (file.Length - 0x100) || sign == 0x17 && size != (file.Length - 0x100)* 2)
|
||||||
|
if (sizesign != 0 || sizesign_high == 0)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user