Page 1 of 1
iPaq h38xx blitting?

Posted:
Sep 15, 2002 @ 1:42am
by Gregory Torres

Posted:
Sep 15, 2002 @ 1:45am
by goodbye

Posted:
Sep 15, 2002 @ 2:01am
by Digby
Ugh. It's not a GAPI bug! This is entirely Compaq's boneheaded move in their display driver.
The screen on the 38xx series of devices is oriented differently from the previous iPaqs. Rather than expose this new orientation through GAPI, they used a feature of GAPI called "gxdma" to expose an intermediate buffer to applications that is oriented the same as previous iPaqs. This intermediate buffer is copied to actual display memory each frame when your app calls GXEndDraw. This extra full-screen copy operation is causing the performance hit you're experiencing.
This was done for compatibility reasons because some popular games didn't test the GAPI caps bits and just assumed that if they were running on a iPaq the screen layout/config was the same. Rather than having these existing games not run on the new iPaqs, they decided to take the perf hit in the name of compatibility.
The good news is that if you want to write your app to the actual video memory address and not pay the perf hit, you can read this thread for how to do it.

Posted:
Sep 15, 2002 @ 2:16am
by goodbye

Posted:
Sep 15, 2002 @ 4:22am
by Gregory Torres
Wow!
Thank you for the amazingly quick replies. I'm glad to know it's easy to fix this problem, although I like using GAPI returns just so it works universally. I guess that won't help me, though :P
-Greg

Posted:
Sep 15, 2002 @ 5:21am
by Digby
Well if you're a GAPI "purist" then you should be calling GXIsDisplayDRAMBuffer and if it returns TRUE, then don't use your own back buffer created in system memory. Instead, use the buffer returned by GXBeginDraw as your back buffer and compose your frame to that. This avoids a full-screen copy operation that you would be doing if you created and managed your own back buffer.

Posted:
Sep 15, 2002 @ 3:34pm
by britcode
My code for the workaround/hack. Think it's okay. Feedback more than welcome.
// See if the device is an iPAQ 3800
memset(&DevName,0,sizeof(DevName));
SystemParametersInfo(SPI_GETOEMINFO,sizeof(DevName)>>1,DevName,0);
if (_wcsicmp(DevName,L"compaq ipaq h3800")==0) Draw3800=1;
// Find out about the primary surface (the screen)
GXDisp=GXGetDisplayProperties();
memset(&Prim,0,sizeof(Prim));
Prim.w=GXDisp.cxWidth;
Prim.h=GXDisp.cyHeight;
Prim.xp=GXDisp.cbxPitch;
Prim.yp=GXDisp.cbyPitch;
if (Draw3800) { Prim.xp=-640; Prim.yp=2; }
...
// Get access to the real screen
if (Draw3800) Scr=(unsigned char *)0xac0755a0;
else Scr=(unsigned char *)GXBeginDraw();
...
if (Draw3800==0) GXEndDraw();

Posted:
Sep 15, 2002 @ 8:28pm
by Phantom

Posted:
Sep 16, 2002 @ 4:03am
by britcode