Datasheet
60 SYMBIANOSGAMEBASICS
point numbers. Most current ARM architectures do not support floating
point instructions in hardware, and these have to be emulated in soft-
ware.
6
This makes the use of floating point numbers expensive in terms
of processing speed when thousands of operations are required. Where
possible, calculations should instead be implemented using integers or
fixed-point arithmetic, or they should be performed in advance on a PC
and stored in static lookup tables to be used at run time in the game. It is
rare that high precision is required for geometric operations such as sin,
cos, and square root, so there is room for optimization, for example, for
sin and cos, the Taylor series can be used to approximate sin and cos to
a number of decimal places.
The use of 32-bit integers should be preferred where possible; 64-bit
integers have run-time performance and memory consumption overheads,
and are rarely needed in practice.
2.9 Tools and Further Reading
This chapter has discussed some of the basic aspects of creating a well-
behaved game loop, handling input, managing interruptions and user
inactivity, and coping with resource limitations.
Where the performance of the game is critical, we advise you to analyze
the code for each device it is to run on, since devices and platforms can
have very different characteristics. A good tool for performance analysis
is the Performance Investigator, delivered with Carbide.c++ Professional
and OEM Editions. A profiling tool, it runs on an S60 3rd Edition
device and collects information about processes, memory, CPU usage,
and battery usage. Within Carbide.c++, the trace data collected can
be reviewed and analyzed. More information, and a white paper that
describes the Performance Investigator tool, giving an example of how to
use it, can be found at
www.forum.nokia.com/carbide
.
For more information about general C++ development on Symbian OS,
we recommend the Symbian Press programming series, described in the
References and Resources section of this book. There are also a number
of papers available on the developer websites listed in that section,
including a discussion forum specifically for C++ games development for
S60onForumNokiaat
discussion.forum.nokia.com/forum
.
6
Some of the high-end phones based on ARM11 processors do have floating point
support, for example, the Nokia N95. To use it, code must be compiled with a particular
version of the RVCT compiler, with floating point hardware support options enabled. The
resultant binaries do not execute on hardware without floating point support.