First post, by Fizzban
- Rank
- Newbie
Hi.. 😀
The C-equivalent to FPATAN is atan2() and not atan(). This bug will break e.g. games that uses this instruction to calculate the angel between two points A and B so they know how to move a sprite from A to B.
Replacing the following line in fpu_instructions.h
fpu.regs[ST(1)].d = atan(fpu.regs[ST(1)].d/fpu.regs[TOP].d);
by
fpu.regs[ST(1)].d = atan2(fpu.regs[ST(1)].d, fpu.regs[TOP].d);
will fix this.
Ahh, finally Orion Burger is working perfectly.. And Ben is no longer walking backwards in Full Throttle.. 😀 Time for the next game.. 😁