20dword
CompressTFD(
byte *pSrc, dword SourceBufferSize,
byte *pDest, word TFDType, word SysID,
void *pPercentFinishedCallback)
24 word OrigSize, CompSize;
25 dword OutBufferSize, NrBlocks = 0, FullSize = SourceBufferSize;
35 void (*PercentFinishedCallback) (dword PercentFinished) = pPercentFinishedCallback;
48 while(SourceBufferSize)
50 if(PercentFinishedCallback) PercentFinishedCallback((FullSize - SourceBufferSize) * 100 / FullSize);
53 OrigSize = (SourceBufferSize > 0x7ffa) ? 0x7ffa : SourceBufferSize;
64 pDest += CompSize + 8;
68 OutBufferSize += CompSize + 8;
69 SourceBufferSize -= OrigSize;
79 if(PercentFinishedCallback) PercentFinishedCallback(100);
word CRC16(word StartValue, void *StartAddress, dword Length)
dword CompressTFD(byte *pSrc, dword SourceBufferSize, byte *pDest, word TFDType, word SysID, void *pPercentFinishedCallback)
word CompressBlock(byte *inputbuffer, word inputsize, byte *outputbuffer)