BBC BASIC for Windows
Programming >> Graphics and Games >> CPU usage of BBCSDL Android (ARM)
http://bb4w.conforums.com/index.cgi?board=graphics&action=display&num=1486764374
CPU usage of BBCSDL Android (ARM)
Post by David Williams on Feb 10th, 2017, 9:06pm
I downloaded about half-a-dozen free games from Google's Play Store onto my Moto G4. Some of the games (e.g. 'Space Invaders') totally hammered the CPU (100% usage) doing nothing more than displaying a static menu. I could actually feel the back of my phone getting hot in the space of a few seconds -- simply for displaying a menu. Typically, a game would use 40 to 60% CPU 'bandwidth'. So it's interesting, perhaps, that with one of my test programs, written in BBC BASIC (very slow compared to Java which is what most Android games are written in) using a 360x640 rendering surface and drawing 100 48x48 semi-transparent sprites, uses only 40% CPU (the CPU doesn't get hot), all nice and smooth. Many (most?) Android games use the GPU to render images -- my sprites are written to a 'bitmap buffer' entirely in software prior to rendering via *MDISPLAY (my custom sprite plotters consist of some pretty shoddy ARM code, no attempt to use NEON SIMD instructions for greater efficiency).
It just leaves me wondering why so many Android games consume so much CPU power (sometimes 100%) even though they appear to be doing next to nothing?
David.
--
Re: CPU usage of BBCSDL Android (ARM)
Post by DDRM on Feb 13th, 2017, 12:28pm
Perhaps they simply have a very tight loop waiting for input - the equivalent of not including a WAIT 1 in BB4W?
To paraphrase Tom Lehrer (who was talking about folk-songs), that's what happens when you let The People write code...

D