Fix Endfield
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user