This is a customized version of Lua (5.1.4) that uses 20.12 fixed point instead of double for its number type. The main reason for this change is to speed up arithmetic (the DS doesn’t have an FPU). Keep in mind that the change in number format limits the usable range to [-219, 219)
Included in the tools folder are a replacement math lib which uses lookup tables for trig functions and a Haskell script. The script takes a sanitized C header file and generates the required code to export those functions as a Lua library.