Find attached a small demo program that calculates the angle between the middle point of the sceen and the mouse pointer position.
This demo only runs on the R39 emulator version of the cx16.
The angle calculated is between 0 and 63, so each quadrant in the circle has 16 different angles (0 to 15).
Please comment to the following article that goes into details on this atan2() approach ...
Sven
Made the logic working on the R38 and R39.