Hydr8gon / sm64

A port of Super Mario 64 for the DSi
Creative Commons Zero v1.0 Universal
127 stars 10 forks source link

Add hardware accelerated floating point square root #40

Closed Kuratius closed 2 months ago

Kuratius commented 2 months ago

Related to #39, #37 Can be disabled with a linker option if it causes issues. I removed the fdiv and fmul implementations again because they weren't that much faster than gcc's own in my tests, but there was a large difference for sqrtf, and I was able to match it the default implementation bit-for-bit just by adding rounding.

Kuratius commented 2 months ago

I apparently also replace a float->u16 function that uses float adds, sorry forgot about this. There's also some changes to the makefile in this.

Kuratius commented 2 months ago

The define in math.h is probably also unnecessary, I'll remove it.

Kuratius commented 2 months ago

image Don't merge this until I get rid of this issue, one of the changes (not the sqrtf) causes a frame to be misrendered at the start of the game. I may open a new PR for just the square root function once it has been retested and added to blocksds.