PocketMatrix forums

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

Is the PPC multi-process?

I was wondering what happened to an application when it loose focus. Does it still runs? (i.e. are timeslices still allocated to it's process?)

Say for example that I am playing game A and decide to switch to game B. Does game A still runs? Will both games try to access the screen at the same time?

When using GDI, this is solved by using DCs. When using GAPI, this is solved by using the GXSuspend() / GXResume() calls. But is all this really needed?
I would have to say yes. When programming pocketsx, there was a bug that caused the application to lose focus, bringing up the home screen. When going to close the program in the memory manager, the pocketpc ran extreamly slow (it took a very long time (up to 45 seconds) for a screen to be completely drawn.
Yes, Windows CE is a decent multi-threading OS, especially with the Windows CE 3.0 kernel rewrite.

Yes, technically multiple games can run at once. More than one process can access the display hardware at once. However, it is implementation-specific as to whether or not a game properly gives up the display / relinquishes processing power when it loses focus. Some games will not allow themselves to loose focus as long as they are running.

If your app loses focus you should leave the display alone, suspend sound activity, and Sleep in your message pump while you await activation.

Dan East
Thanks for the info. I always assumed that there was a mutex hidden behind GXBeginDraw()/GXEndDraw(), but now I have doubts. I can't find any information on the subject (as it always the case with GAPI) and am wondering if there is indeed a mutex. I assume that's the intent, but what about the actual implementations?

I can't find an easy way to test this... Basically one process should first lock the framebuffer (GXBeginDraw) and then another process try to lock it. The return value should be 0 if there is indeed a mutex. I need a way to check this, any idea?
Run one app that grabs the mutex then goes to sleep. Then launch another app that tries to do the same thing. Run the second app in the debugger and see if the API that supposedly grabs the mutex blocks until it is free, or returns an error.
Thanks Digby, I didn't think about the obvious: starting the second application from the debugger.
Kzinti, I don't believe GAPI uses any technique to restrict access to the buffer. The ARM version of Pocket Quake used to call GXBeginDraw once and then not call GXEndDraw unless it lost focus. Yet I could still use Virtual iPaq at the same time to do screenshots from my PC and watch the action unfold real-time, so obviously virtual iPaq could get the display buffer even if Pocket Quake had it already.

Dan East
i can only agree with Dan.

my GAPI screenshot program runs on the device and is activated by pressing the power off key. The funny thing is that, when activated, it just gets the foreground window and blits it to a memory bitmap before saving as a bitmap.

This seems to work on all PocketPC's i have tested it on, with one exception, the 38xx iPAQs. When run on an 38xx ipaq, it always generates a screenshot of the non-gapi foreground window.

cryo
That pretty much answer my question, thanks.
For some reason I'm not surprised it doesn't work on a 3800.