Pages: [1]
|
|
|
Author
|
Topic: Planet rotation task causes lander slowdown in my port to GP2X (Read 1938 times)
|
Senor Quack
Zebranky food
Offline
Posts: 3
|
Hello, I have taken over the port of UQM to the GP2X 200mhz ARM handheld. I have gone a long way towards making this port better than ever on this device, and the users are very happy.
My problem is that we still have to overclock a little bit to make the planetary lander perfectly smooth on planets with heavy activity. I have gone to pretty long lengths to improve performance, including custom writing a fullscreen blitter in ARM ASM, changing the internal mixing code entirely over to integer, integrating ARM ASM memory handling routines, integrating an ARM ASM ivorbisdec library etc etc.
Anyways, by what is probably a bit of good luck, I have discovered that because the PROFILE_ROTATION flag has accidently been left on in my compile, I was seeing the following output on stdout:
Rotation frames/sec: 242/3460(msec)=61.111111
Big deal, you say? Well, I get this profiling output every few seconds even when I'm guiding the lander around the planet collecting minerals. Doing a search through the source code, I have discovered that this output is from code in the function RenderLevelMasks in plangen.c, called from within the rotate_planet_task function. This appears to be all the code related to drawing the rotated planet in the orbit display, which sucks up a LOT of valuable ARM CPU cycles.
The ARM seems to be struggling with handling all that math, which I would guess should be suspended while you're just down on the surface. Please correct me if I am wrong. Should I submit a bug report to request this be the case? Any suggestions on how to go about disabling the rotate_planet_task code while on the surface? I am not familiar with coding multithreaded programs, unfortunately.
Thanks
|
|
« Last Edit: December 22, 2007, 11:38:40 pm by Senor Quack »
|
Logged
|
|
|
|
Senor Quack
Zebranky food
Offline
Posts: 3
|
I have discovered what I need to add to the code to get planet rotation code to correctly pause when the lander is on the surface. I now have the rotation code completely paused when collecting minerals. I will be sumitting a bug report to explain how in the next few days..
(A check is being made in one place to see if rotation is paused, but not in another, in plangen.c)
|
|
|
Logged
|
|
|
|
|
Novus
Enlightened
Offline
Gender:
Posts: 1938
Fot or not?
|
As far as I can tell from a quick test, there are no ill effects from extending the check on PauseRotate in rotate_planet_task to encompass the calls to RenderLevelMasks and SetShieldThrobEffect, although I'm not convinced that it's impossible for one old frame (wrong planet angle) to be displayed after unpausing rotation. More careful thought is required than I can handle right now (at 3:30 AM), but I think I have a pretty good idea what to check in a patch.
|
|
|
Logged
|
|
|
|
Pages: [1]
|
|
|
|
|