Fix Endfield

This commit is contained in:
Maverick Chang
2025-02-17 14:30:24 +09:00
parent dbf3a8f16a
commit 8446538322
17 changed files with 481 additions and 157 deletions

View File

@@ -4,6 +4,16 @@ namespace AssetStudio;
public class LZ4Inv : LZ4
{
public new static LZ4Inv Instance => new();
protected override (int encCount, int litCount) GetLiteralToken(ReadOnlySpan<byte> cmp, ref int cmpPos) => ((cmp[cmpPos] >> 4) & 0xf, (cmp[cmpPos++] >> 0) & 0xf);
protected override (int encCount, int litCount) GetLiteralToken(ReadOnlySpan<byte> cmp, ref int cmpPos)
{
var val = cmp[cmpPos++];
var lit = val & 0b00110011;
var enc = val & 0b11001100;
enc >>= 2;
return ((enc & 0b11) | enc >> 2, (lit & 0b11) | lit >> 2);
}
protected override int GetChunkEnd(ReadOnlySpan<byte> cmp, ref int cmpPos) => cmp[cmpPos++] << 8 | cmp[cmpPos++] << 0;
}