XboxDev / nxdk

The cross-platform, open-source SDK to develop for original Xbox: *new* xdk
432 stars 66 forks source link

Missing Microsoft CRT float functions #452

Open JayFoxRox opened 3 years ago

JayFoxRox commented 3 years ago

nxdk doesn't implement much of https://docs.microsoft.com/en-us/cpp/c-runtime-library/floating-point-support?view=msvc-160 yet. However, many of these are important for video-games and they are commonly used in rendering or physics libraries.

The ones I need relatively quickly are these:

These are used in various projects and kept coming up while porting stuff.

Maintainers: Feel free to edit this post to add a checklist of supported / missing functions.

fgsfdsfgs commented 3 years ago

I have a partial implementation of float scanning and formatting in fgsfdsfgs/nxdk-pdclib#1, but it's done on the pdclib side and I'm not sure if the implementation is adequate. It seems to be enough for Odamex and Quakespasm to read maps and configs correctly. Let me know if I should PR it to nxdk-pdclib or if you'd prefer a different approach.

JayFoxRox commented 3 years ago

I have a partial implementation of float scanning and formatting

I think we should wait for formatting (and potentially scanning) until https://github.com/DevSolar/pdclib/issues/5#issuecomment-818028133 has been resolved. Unfortunately, pdclib will reject anything we'll do because of license concerns, so I'm also not sure how to continue. Usually we implement our own stuff in hooks (on this repository).


I probably shouldn't have brought up atof (and I've removed it from this issue). Focus for this issue should be on the MS specific extensions for working with x87/SSE (= those parts we could not accomplish by just linking another libc).