Hi there devs and all that have more insight into the SDK and programming/coding on OS4 than me (no big deal, i have near to nothing)
I?m asking for help on a specific problem, the OS4 build of ScummVM has some flaws on certain games which only shows up on our platform. One specific bug is the infamous "moonwalking bug" which lets the characters walk backwards in "The Curse of Monkey Island" and "The Dig".
One of the ScummVM devs hit the jackpot by pointing to a specific function I didn?t even know exists. atan2()
Take a look at the sourceforge bug tracker item to get an idea about what was going on.
The problem: Juha (Mr_Capehill - the current official maintainer) won?t be around for quite some time and the Scumm devs already closed this item due to the fact that it's not ScummVM related.
Can someone please test if the function is broken or simply not used in the right way and offer ideas to fix for OS4?
It IS working now, at least on my build, but the "patch" provided by cyx won't go into the SVN because it would break the builds on other platforms (or so i understand it)
Thanks very much for your help
PS: If this is the wrong forum, please move (the thread)
First information you need to post if you have problems with funtions from external libraries (not part of your own package)... what 'C'-Runtime Library you are using. Are you using newlib or clib2? and what version?
Best regards, hnl_dk - Henning Nielsen Lund [Denmark]
It could be easily verified by compiling the atan2 test program (I would test 7 calls, pairs of args such as:(1,1) (0,1) (-1,1) (-1,0) (-1,-1) (0, -1) and (1, -1).
Compile it vs clib2 and via newlib and check results. I dunnoh how to do it and if it is possble, but if it is: compile vs system math libs as well, but that could be same as newlib (I'm too rusty after such a long time without A1).
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
It could be easily verified by compiling the atan2 test program (I would test 7 calls, pairs of args such as:(1,1) (0,1) (-1,1) (-1,0) (-1,-1) (0, -1) and (1, -1).
Compile it vs clib2 and via newlib and check results. I dunnoh how to do it and if it is possble, but if it is: compile vs system math libs as well, but that could be same as newlib (I'm too rusty after such a long time without A1).
Morning Jack...
I may be able to compile this test program, if i find it... everything else...eh, WHAT?
I want him to past how atan2() is used, as it does not need to be atan2() that is the problem, it could also be other functions that needs to be tested.
Best regards, hnl_dk - Henning Nielsen Lund [Denmark]
It could be easily verified by compiling the atan2 test program (I would test 7 calls, pairs of args such as:(1,1) (0,1) (-1,1) (-1,0) (-1,-1) (0, -1) and (1, -1).
Compile it vs clib2 and via newlib and check results.
And what are the correct results?
atan2() is broken in at least 2 of 3 AmigaOS C libraries 6.RAM Disk:> type test.c #include <math.h> #include <stdio.h>
edit : hnl_dk's post below reminded me that iot should be between -180 and 180 degrees, corrected last 3 lines, thanks.
Edited by Jack on 2007/1/7 11:05:16
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
Com'n, little trigonometry won't harm anyone. If you're going to implement 3d api for AOS4 --- it's essential
Quote:
atan2() is broken in at least 2 of 3 AmigaOS C libraries
Even longlived gnuplot has a bugh in tanh() (there's a gap between 355-745deg)
Jack
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
My appologies, you're right. Blanked the post, The 0,0 one shoudn't be nan? Gone to check...it is 0.0
Jack edit: checked
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
What does the default comilation uses? Newlib? Does newlib loads the libs: stuff?
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
I've fixed it in newlib.library 52.7, but atan2(0,0) still returns NaN, just like in libnix, which is correct IMHO and the 0 from glibc and clib2 are wrong!?