PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

PocketHAL 0.6.0 Released

The sixth release of PocketHAL, the next generation library for Pocket PC game development has been released.

Get it fresh at: http://pockethal.droneship.com

PocketHAL can currently be seen as an alternative to GAPI and GAPI-based libraries. You though GAPI was the fastest way to do graphics on your Pocket PC? Think again. PocketHAL can often run twice as fast as GAPI and further optimizations are in the work.

What's new in the 0.6 build:

* Special support for MediaQ devices.
* API changes to accomodate future devices / platforms.
What sort of speedups can MediaQ devices expect?
sponge wrote:What sort of speedups can MediaQ devices expect?


It depends on the type of games.

Static games will see a big speed increase while game with lot of scrolling/mvt will not.

(That's my understanding of the MediaQ optimisation implemented in PHAL).
The speed up will be proportional to the number of pixels that don't change from frame to frame.

ex: the Ipaq 2215 takes around 17 ms to update the entire screen. With PocketHAL, you can expect this update to take anywhere between 3 ms and 19 ms, depending on how many pixels need to be updated.
Thierry, is there a way to manually DISABLE this type of optimization in PH? I ask because I could see in some instances where you'd want to know exactly how long the update is going to take, even if it's not a good speed. I would expect a full-screen update each frame to take just about the same each time, regardless of what has changed or not, if the optimizations were off.
Fzammetti: currently there is no way to disable this, but it could be easily added. I am unsure how to name the feature and/or expose it.

Perhaps I could add a "flags" field to the DisplayParameters structure and one of the flags could be "FLAG_DISABLE_SLOW_FRAMEBUFFER_OPTIMIZATION".

At first I expected 3D apps to suffer from this optimization, but all reports have said that the game was running just as fast (no speedup/no slowdown). That's the reason I didn't bother adding this disabling functionality.

I've seen the slowdown only using pathological cases (i.e. changing all pixels every frame).
Thierry wrote:

I've seen the slowdown only using pathological cases (i.e. changing all pixels every frame).


Changing all pixels every frame is not a pathological case, I'm using full screen scrolling and crossfade very often in my 2D games.

It would be cool if we can disable this feature
How about SET_ME_TO_TRUE_IF_YOU_REALLY_DONT_WANT_MAXIMUM_PERFORMANCE_FROM_YOUR_APP?

Seriously though, I think the flag method probably is the right way, whatever the field name. It would seem kind of odd to have to call a disableOptimzations() method (or alternatively, an enabledOptimzations() method).

I would also think it would rarely be used, but for example, the main menu of my current project has a scrolling background, so every pixel in fact IS changing every frame. To be able to turn that off would be very nice in that case.

Of course, that raises the next logical question... Can you make it so that it can be turned on and off during a program run? Maybe that says a method is in fact the right approach then. But maybe it won't be possible, but being able to turn it off at the start would still be good in a case like mine (then again, frame rate on a menu isn't terribly important, but I digress).
Hehe, StephC and I thought of the same kind of test case. :)

You know, here's an interesting test to see the real-world difference... just use Burning Sheep's plasma demo. What's the difference with the optimization on and off?
fzammetti wrote:Hehe, StephC and I thought of the same kind of test case. :)

You know, here's an interesting test to see the real-world difference... just use Burning Sheep's plasma demo. What's the difference with the optimization on and off?


Burning Sheep is THE reason I didn't put the functionality in. It runs at 18.3 ms, which isn't that much slower then the optimal 16.7 ms. And it does update all pixels each frame (in theory, not in practice).

Even for a side scrolling game, nobody reported any slowdown when testing it. (But it doesnt mean it won't slow down.) Even though a side-scrolling or a 3D game will theorically change all pixels, it often doesn't. This can come from the sky (constant color) or the player's score / life remaining, etc. Anything that is static will contribute toward the optimization.

I'd like to add a flag at initialization (or at Swap() time), but I don't know how to call it. Any ideas?
I'd suggest something simple... GPU_OPTIMIZATIONS, or maybe USE_OPTIMIZATIONS, or even just plain OPTIMIZATIONS. If you think that might be too generic, then maybe FLIP_OPTIMIZATIONS. A straight boolean, whatever the setting is "sticks" until you change it, and checking it at swap() time sounds good. That should allow on-the-fly changes, right?
Thierry wrote:

I'd like to add a flag at initialization (or at Swap() time), but I don't know how to call it. Any ideas?


FORCE_FULL_UPDATE

I'd like to be able to change some parameters during the run time (switching vsync on or off for example).

A function call with a parameter containing all the config flag...
Pejo Software - Per · 16 Feb 2004, 23:44 UTC
A real game example! Beshaped 2 running on an iPAQ 2210:

With GapiDraw:
Normal gameplay: 35-43 fps.
fading transition from game to menu: 22 fps.

With PocketHAL 0.5 / "PeJoDraw":
Normal gameplay: 38-47 fps.
fading transition from game to menu: 22 fps.

With PocketHAL 0.6 / "PeJoDraw":
Normal gameplay: 50-100 fps.
fading transition from game to menu: 22 fps.
You will probably need FORCE_FULL_UPDATE for other things, like when you app receives focus again after it lost focus to some other app. Cause with your current optimizations, redrawing the screen would do nothing, as it would think that 'nothing' changed. We had this problem and came up with the flag FORCE_REDRAW to handle it.
Thanks for the head up RCP, I didn't think about that one.
PocketHAL 0.6.1 has been released. For more details, please see this thread:

http://www.pocketmatrix.com/forums/view ... hp?t=15091