Hi, I want to know how fast the emulator is compared to the speed of a normal PPC. I don't have one, so I'm using the emulator and the game is running at 120 FPS, so I'm interested how fast that's on a PPC.
How fast is the Emulator?
The main issue is probably not the average speed compared to a PPC, but the huge difference in speed of floating point code on the emulator and the PPC. Floating point code will run MUCH faster on the emulator than on a PPC.
well, it pretty much depends on your PC configuration. FOr me values are like this:
1.using fpu PPC is 15-20 times slower
2.using cpu only, doing some graphics etc, PPC is 3-6 times slower.
As you can see it's pretty much impossible to answer your question exact. It's best to ask someone to try your game and check how many fps he has got. This way you will know how much fps you can expect from the device after some changes, assuming you don't start using fpu. and yes, fpu is a performace killer, DON'T USE IT! Use Fixedpoint math. FPU might be used only for some calculations at initialization time, which are hard to do with fixedpoint math.
1.using fpu PPC is 15-20 times slower
2.using cpu only, doing some graphics etc, PPC is 3-6 times slower.
As you can see it's pretty much impossible to answer your question exact. It's best to ask someone to try your game and check how many fps he has got. This way you will know how much fps you can expect from the device after some changes, assuming you don't start using fpu. and yes, fpu is a performace killer, DON'T USE IT! Use Fixedpoint math. FPU might be used only for some calculations at initialization time, which are hard to do with fixedpoint math.
Duron 600.
Try to avoid FPU, if you use a lot of FPU you will end with few fps or even lower.
Try to avoid FPU, if you use a lot of FPU you will end with few fps or even lower.
How would you calculate this w/o using FPU?:
Player.xpos+=ms_needed_for_one_frame*acceleration*0.001;
I could maybe lock the game at 30 fps or update the positon all 5 frames but isn't there a better solution?
Player.xpos+=ms_needed_for_one_frame*acceleration*0.001;
I could maybe lock the game at 30 fps or update the positon all 5 frames but isn't there a better solution?
Yes. As MirekCz said above, use "Fixed Point" maths.
I put a link to an ARM document about fixed point in the 3d thread earlier today (it's around elsewhere apparently but I didn't look for it):
http://forums.pocketmatrix.com/viewtopic.php?t=4136
Read the proviso(s) in that thread too, you need to work out what kind of accuracy you need, and methods of retaining it in your system - using fixed point is fast, but it doesn't come without a bit of extra calculation
In your example, you need to have *at least* enough accuracy in your fixed-point system to represent 0.001..ish, which means you want *at least* 10 bits of "decimal" (1/2^10 = 1/1024) to get *close* (0.0009765625) by my (hasty) calculations.
So, then, you'd say that:
0.001 is about 1/1024
So, in (binary) fixed point, 1/1024 =
0.0000000001
So, you multiply your (fixed point) number by that and shift it back to where it should be, and you have your result * "0.001"(ish).
Let me know if you want any more information, examples, etc, and I'll do some when I get bored at work tomorrow.
Cheers,
Refractor
I put a link to an ARM document about fixed point in the 3d thread earlier today (it's around elsewhere apparently but I didn't look for it):
http://forums.pocketmatrix.com/viewtopic.php?t=4136
Read the proviso(s) in that thread too, you need to work out what kind of accuracy you need, and methods of retaining it in your system - using fixed point is fast, but it doesn't come without a bit of extra calculation
In your example, you need to have *at least* enough accuracy in your fixed-point system to represent 0.001..ish, which means you want *at least* 10 bits of "decimal" (1/2^10 = 1/1024) to get *close* (0.0009765625) by my (hasty) calculations.
So, then, you'd say that:
0.001 is about 1/1024
So, in (binary) fixed point, 1/1024 =
0.0000000001
So, you multiply your (fixed point) number by that and shift it back to where it should be, and you have your result * "0.001"(ish).
Let me know if you want any more information, examples, etc, and I'll do some when I get bored at work tomorrow.
Cheers,
Refractor