There is a scheme already in place to combine two integer coordinates into one Long value. The integers range from -400 to 400, on both an x and y axis.

I do not know the logic driving how the coordinates are combined into one value. I assume it is a simple "high byte low byte" technique using a high integer and low integer. But I don't know how to do that.

Here are some actual values:

200,200 = 160801
-100,-100 = 400801
255,0 = 321056
0,255 = 116546
-127,127 = 218947
63,-63 = 371327

How do I go from coordinates to long and back again?