MAMEWorld >> Programming
Index   Flat Mode Flat  

AWJ
Reged: 03/08/05
Posts: 936
Loc: Ottawa, Ontario
Send PM
Re: mame 0.163 on ARM32 - raiden2 issue FIXED!
08/08/15 03:36 AM


> 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.

Congratulations on finding the issue and fixing it! If you're able to, please submit a Github pull request with the fix.







Entire thread
Subject Posted by Posted on
* mame 0.163 on ARM32 - raiden2 issue ole 08/04/15 12:38 AM
. * Re: mame 0.163 on ARM32 - raiden2 issue R. Belmont  08/04/15 04:47 PM
. * Re: mame 0.163 on ARM32 - raiden2 issue ole  08/04/15 11:08 PM
. * Re: mame 0.163 on ARM32 - raiden2 issue Haze  08/04/15 11:30 PM
. * Re: mame 0.163 on ARM32 - raiden2 issue ole  08/05/15 11:18 PM
. * Re: mame 0.163 on ARM32 - raiden2 issue Haze  08/07/15 03:44 AM
. * Re: mame 0.163 on ARM32 - raiden2 issue ole  08/07/15 10:32 PM
. * Re: mame 0.163 on ARM32 - raiden2 issue AWJ  08/07/15 02:56 PM
. * Re: mame 0.163 on ARM32 - raiden2 issue ole  08/07/15 10:36 PM
. * Re: mame 0.163 on ARM32 - raiden2 issue FIXED! ole  08/08/15 01:33 AM
. * Re: mame 0.163 on ARM32 - raiden2 issue FIXED! AWJ  08/08/15 03:36 AM
. * Re: mame 0.163 on ARM32 - raiden2 issue FIXED! ole  08/09/15 01:04 AM
. * Re: mame 0.163 on ARM32 - raiden2 issue Haze  08/04/15 01:11 AM

Extra information Permissions
Moderator:  Pi 
0 registered and 1 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2282