Ah... finally fixed !
the issue is indeed in raiden2cop.c, there's automatic casting from negative float to unsigned int when atan() function is used. On ARM the result is always 0 (not on Intel though), but explicit conversion to signed int fixes it.
so for example: cop_angle = atan(double(dy) / double(dx)) * 128.0 / M_PI; should be cop_angle = (int)(atan(double(dy) / double(dx)) * 128.0 / M_PI);
in order to make it work on ARM.
Later on I found some blog confirming the issue: http://www.embeddeduse.com/2013/08/25/casting-a-negative-float-to-an-unsigned-int/
The guy in the blog above recommends using -Wconversion warning option so the issue is more obvious during compilation.
|