@SinanSam460
Is this sourcecode reverse engineered? This would at least explain the weird namings.
I am pretty sure that the problem is elsewhere in the code.
The disassembly shows that *xf points to 16bit aligned address (0x5B24264E) where it must be 32bit. The pointer itself is 32bit aligned (0x5B01823C).
lfd f1,40(r31) Load f1(double) from address 0x5B018248
bl 0x7F73668C branch to linked function sin()
fmr f12,f1 Copy f1 to f12 (result from sine function)
lis r9, 23527 load immediate shift (r9 = 0x5B070000)
lfd f0,-7736(r9) Load f0 with double from address 0x5BE6E1C8
fmul f0,f12,f0 f0 = f0 * 0.788011
fadd f0,f31,f0 f0 = f0 + 413.0
frsp f0,f0 double -> Float
lwz r9,28(r31) Load r9 with word from address 0x5B01823C
stfs f0,0(r9) Store float in F0 to 0x5B24264E
The double loads are double aligned, so that is ok.
The loaded value from (double)s_35e[n].XLocation seems to be 413.0. Strange because this is supposed to be a __BYTE__
The NaN is most likely the result of something bogus loaded from 0x5BE6E1C8 -> lfd f0,-7736(r9). This should have been 12.0
The question remains why there is only an alignement issue on the X5k and sam460. And then specifically on AmigaOS4. Because as I understand it, the MOS version runs fine.
But this is a question for the compiler experts.