I just merged a change that exports a jump table for a C128-compatible floating point Math library:
change: https://github.com/commanderx16/x16-rom/issues/231
documentation: https://github.com/commanderx16/x16-docs/blob/master/Commander X16 Programmer's Reference Guide.md#math-library
There is something I would like some feedback on:
As I understand it, the calls FADDT, FMULTT, FDIVT and FPWRT of the original C128 API didn't work as expected and were useless. If you look at these subroutines in x16-rom/math/*.s, you'll see that they require the flags set up in a certain way, which a client can't reproduce without breaking the abstraction and reading some internal state of the library.
I appended replacement calls FADDT2, FMULTT2, FDIVT2 and FPWRT2, which do the necessary setup, to the end of the jump table. Now I'm wondering whether I should replace the original calls with these instead. Given that they were probably never useful (or used!), it's safe (and clean) to replace them.
What do you think? Anything I'm missing?
Edit: Here's an article that explains the problem: https://www.c64-wiki.de/wiki/FADDT; English: https://www-c64--wiki-de.translate.goog/wiki/FADDT?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp
See also: https://github.com/commanderx16/x16-rom/issues/244