Z Square Root Table Format
Jump to navigation
Jump to search
SQROOT.BIN supplies a distance lookup table in Z.
File format
The file has 2048 bytes (0x800), loaded to the buffer referenced by static address 0xf4028. The targeting code indexes this buffer and reads an unsigned byte, so its stored results are bytes, not 16-bit words.
The complete mathematical generation rule and valid input range are not established here; preserve the original table unless all consumers have been checked.
Source code
From re-z, the open-source browser port:
- src/game/boot-main.js – fn6f0d3 loading
- src/game/subsys/targeting.js – distance lookup
- src/game/boot-sys.js – allocation
Credits
This file format was reverse engineered by VorticonCmdr. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)