PocketMatrix forums

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

Flickering on new PocketHAL and new devices?

There was an issue with flip operation when I didn't update the whole screen, but only the small rect.
I.e. when I called say display->Update(Rect(100,100,150,150)) to only update loading progress, display would flicker on some devices. This is absolutely true for PocketHAL 0.8.x (AFAIR) and ipaq h2110.

Now I would like to have this kind of optimization in a whole game, including gameplay - for battery saving purposes and also because framerate is not sufficient.
Will it work? Will it not flicker on all devices, especially new ones?

PS: Actually, I'm not using pure PocketHAL - it's PocketFrog, but I believe this flickering is PocketHAL's issue, not PocketFrog's.
Jaguard, the rectangle you specify to Update() can be used to optimize the update, but it isn't used to clip the update. Said another way, PocketHAL might update only the specified rectangle, a bigger area or even the whole screen.

The behaviour is this way for performance reasons and also because some devices / APIs simply don't allow the updating of sub-sections of the screen.

Let me know if this explains your problem or not. If you have genuine flickering, then it might be a problem with the (newer) device. You are encouraged to use update rectangles to save on battery power and for better performances.
Kzinti wrote:Jaguard, the rectangle you specify to Update() can be used to optimize the update, but it isn't used to clip the update. Said another way, PocketHAL might update only the specified rectangle, a bigger area or even the whole screen.


So, if I get it right, I can in fact use this kind of optimization, but:

1. I should clip the render manually using display->SetClipping() - this is actually what I was planning to do.

2. On some devices the whole screen would be updated.

But tell me, what would happen if I don't draw anything outside the clipping rectangle (I.e. I did it only once, 300 frames ago), but pocketHAL would be forced to update the whole screen? Isn't it actually how this this flickering comes into place?

Let me know if this explains your problem or not. If you have genuine


Well, in fact it doesn't. I have to be sure that I won't get flickering on all current devices, and also on future ones (ok, say 99% of them).

If I'm not, I better use a "safer" way, though it is less effective - I will "prerender" the whole screen to texture and use it as a background. It should maintain fine framerate, but hardly save enough battery power.


flickering, then it might be a problem with the (newer) device. You are encouraged to use update rectangles to save on battery power and for better performances.


Actually, this h2210 which had this flickering issue, is a pretty old one.
Ipaq 2110 or 2210? I actually have the latter and can try to replicate your problem, but I do not have access to a 2110.

Any chance you can send me some code that exposes the problem? (Here or by email).
OK, if you are talking about the Ipaq 2210, then I think I know what is going on.

The 2210 has a MediaQ chip. PocketHAL's MediaQ driver provides SWAP_DISCARD semantics by default (where most devices/drivers provide SWAP_COPY semantics). When you are only updating parts of the screens, you want to have SWAP_COPY semantics, otherwise you will get flickering outside your update rectangle.

Try initializing PocketHAL's display with SWAP_COPY and let me know how it goes.
Yes, I have misspelled the number the first time - it really was 2210. I never had it, it's just that users were telling me that they are experiencing flickering while game was loading graphics.

I don't have a code, since I have rewritten this part, and the problem's gone once I started updating the whole screen. This was more than 2 years ago, but every time the idea of partial update came into my mind, I'd then recalled this issue and threw it away.

Try initializing PocketHAL's display with SWAP_COPY and let me know how it goes.

I have no idea how it goes(since I don't have such device), and I don't even know how to initialize PocketHAL this way. I struggled through the pocketfrog sources, and it looks like there's no direct way to access this structure. Allright, I can modify the Game framework, but will it help?

The 2210 has a MediaQ chip. PocketHAL's MediaQ driver provides SWAP_DISCARD semantics by default (where most devices/drivers provide SWAP_COPY semantics). When you are only updating parts of the screens, you want to have SWAP_COPY semantics, otherwise you will get flickering outside your update rectangle.


So I'll just hardcode SWAP_COPY all the time, and it will work on all devices, right? There's no way SWAP_COPY semantics wouldn't work?

PS: I thought that I add that it's not about h2210 - it's an old device, and I don't even care if the game doesn't works there. But I do care if it works on all other 100s of WM devices. And there's no way I could test all of them, so if there's a slightest chance for unexpected behavior (i.e. flickering), I'd better stick to a safer way.
Yes SWAP_COPY will work on all devices. If you use an update rectangle, then yes, use SWAP_COPY and you will be fine.
Thanks a lot, Kzinti! I'll stick with partial update then.