logo separator

[mkgmap-dev] a few more typ compiler problems

From Steve Ratcliffe steve at parabola.me.uk on Fri Dec 30 10:42:46 GMT 2011

On 29/12/11 22:31, n Willink wrote:
> 2 byte lengths are : (length of txt -5)*2) / (2*2)
> no idea if it allows for 3 byte lengths...

The way I think about it is that the binary representation
of the integer ends in a 1 followed none or more number of zeros.
The total bit length of this suffix is the number of bytes in the integer.
You then remove the suffix by shifting right by the suffix length (or
equivalently divide by 2 that number of times).

   1 - 1 byte
  10 - 2 bytes
100 - 3 bytes

I didn't bother dealing with the 3 byte case in the typ file. If
anyone really needs more than 64k bytes of strings I am sure they will
let me know!

..Steve



More information about the mkgmap-dev mailing list