Fixed point format
------------------
For more precise calculations SWOS uses 32-bit fixed point numbers, with 16 bits for integer part and 16 bits
for fractional part. Integer part has a sign bit (highest bit), while fraction has no sign, and is always
positive.

s|aaaaaaaaaaaaaaa.bbbbbbbbbbbbbbbb

Value = a + 2^-16 * b
or
Value = a + b / 0x10000

Some examples (in hex notation):
 0.5  0000.8000
-0.5  ffff.8000
 3.25 0003.0400

When stored in memory, first word is the fractional part, second word is the integer part (offset +2) - most of the
time only integer part is used.

They can be added and subtracted as 32-bit numbers. Shifting left and right also works. After multiplying two
numbers result needs to be shifted right 16 bits.

# Conversions

To floating point:
    (value & 0xffff) / 0x10000 + (value >> 16)

From floating point:
    (int(floatValue) << 16) | ((floatValue - int(floatValue)) * 0x10000)

Rounding to integer:
    (value >> 16) + ((value & 0xffff) > 0x8000)

# Sprite speed

Sprite speed is a 16-bit signed Q7.9 value: the upper seven bits include the sign and the lower nine bits are
fractional. Consequently, 512 represents 1 pixel per game tick before platform-specific movement scaling.
For example, 256 is 0.5, 1024 is 2, 1280 is 2.5, 2560 is 5, and 2688 is 5.25 pixels per tick.

CalculateDeltaXAndY() multiplies speed by signed Q1.15 sine/cosine direction components and shifts the product
right by 8. The result is the signed 16.16 delta stored in the sprite. The original-compatible calculation first
shifts each direction component right by 8 and then multiplies it by speed, retaining the original truncation.

On the PC movement path, x/y deltas are additionally scaled by 41/64 (0.640625). The Amiga movement path does not
apply this extra scale.
