This time there is a true bug very hard to investigate.
The two C file differ of a single line: the condition in the WHILE loop at line 77
In one case a Key is tested to exit
In the other the loop is infinite
Nevertheless, the code generated for the math at lines 150-163 (3D rotation) which stay equal, differ drastically. The good file is using much less instructions and generate a working rotation.
The bad file is using heavily the stack generating dull sequences of data loading on (IX).
Not only the code is slow and long, but it is also broken. Numerically the results of the math are not equivalent and this bad code generate numeric errors and invalid rotation.
The C code is exactly the same, except for the condition of the while (!)
The math is totally different and in the bad code does not work
You need also this file to compile the C.
I am using Version 4.4.1 #14868 (MINGW64)
Last edit: Ragozini Arturo 2024-05-23
Other required files to compile the project are here
Realistically, for SDCC devs to look into this, we need a small self-contained code sample to reproduce the issue. The code provided so far is big, and has external dependencies.
Can't check if this still affects current SDCC, since we do not have a self-contained code sample to reproduce the issue.