Line 15: |
Line 15: |
| |- | | |- |
| | 4 bytes | | | 4 bytes |
− | | 3 bytes | + | | 4 bytes |
− | | Size of uncompressed data | + | | Data about the compression - the first three bytes are the size of the uncompressed data and fourth is the compression method, which should always be 0x10 - note this value is stored big endian. |
− | |-
| |
− | | 7 bytes
| |
− | | 1 byte
| |
− | | Compression method - should always be 0x01
| |
| |} | | |} |
| | | |
Line 40: |
Line 36: |
| | 4 bits | | | 4 bits |
| | 12 bits | | | 12 bits |
− | | Offset - the offset within the decompressed data of the data referred to by the reference | + | | Use to calculate offset within uncompressed data referred to by the reference. |
| |} | | |} |
| | | |
− | For example, a reference 0x24AD would refer to 2 + 3 = '''5''' bytes of data at offset 0x4AD in the uncompressed data. | + | Offset is calculated by the current "place" you're writing to in the uncompressed data subtract the value in the reference subtract 1. For example, if your current "place" is 0x9EB3 a reference 0x24AD would refer to 2 + 3 = '''5''' bytes of data at offset 0x9EB3 - 0x4AD - 1 = '''0x9A05'''. |
| | | |
| ==Example Code== | | ==Example Code== |