Header: 0-3:Hmr version=0 for normal, 1 for fastspr 4-7:Size of decomped file 8+: data: ... Byte info stuff: <&10 type 1 <&20 type 2 <&40 type 3 <&80 type 4 &FF overrun error (?) other type 5 Type 1: If <15 then repeat + 2 times Else if =15 then repeat 256 times Type 2: ... Read ( & F) + 1 bytes of data straight to output Type 3: = 000CCCHH = LLLLLLLL P = - HHLLLLLLLL Output CCC+2 bytes from P, subtracting 1 from P each loop Type 4: = 00CCCAAF = BBBBBBBB If AA>=2 then D=AA+1 else D=AA D = 1 << D P = - FBBBBBBBB S = 0 Output CCC+2 bytes from P+(S >> 2) where S=S+D each loop Type 5: = 0CCCCAAA = BBBBBBBB P = - AAABBBBBBBB Output CCCC+2 bytes from P, adding 1 to P each loop is the pos of the last byte output, not the next free spot Need output buffer of 4k to work properly version 1: a=offset from file start b=a<<2 a=a-len>>2 if a>=0 then b++,b=b-len a=a-len>>2 if a>=0 then b++,b=b-len a=a-len>>2 if a>=0 then b++,b=b-len return b as address to use do above translation on formats 3,4,5 just before loading, and just before output on *all* formats. len is the real length rounded up to a whole number of words.