PocketMatrix forums

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

Landscape Quickie

Hi everyone, hope you are all well!

I've got a new toy - Asus A636, loving it so far.

One thing I've noticed is when I switch Windows Mobile V5 to Landscape and run my emu, PicoDrive, Rom selection is fine but it switches back to Portrait when it actually plays the game, which is a bit odd! (It uses GAPI by the way.) I guess somehow it 'knows' it's a legacy app.


What's the general method for getting it working in Landscape too?
Using GAPI will force the display back to 'emulation' mode... which in your case would cancel out the rotation. On VGA screens, it either pixels doubles or actually changes the display mode. Thus we try not to use GAPI on the newer devices. We use raw access via the ExtEscape or just use the GDI. The newer devices are so much faster that we found you can use the GDI and still coast by on performance. Using the raw frame buffer pointer is as fast as the old GAPI was, so this works best.

The basic way we decide is something like this...
Make sure RC file has HI_RES_AWARE in it. Make window fullscreen and get the size. Ask GAPI what the size of the screen is. If these sizes match, then use GAPI. If they don't match, see if you can get a pointer to the framebuffer (via ExtEscape shown below). If you can't, then just use the GDI.

Code:

#define GETRAWFRAMEBUFFER 0x00020001
typedef struct _RawFrameBufferInfo
{
WORD wFormat;
WORD wBPP;
VOID *pFramePointer;
i32 cxStride;
i32 cyStride;
i32 cxPixels;
i32 cyPixels;
} RawFrameBufferInfo;

RawFrameBufferInfo frameBufferInfo;
HDC hdc = GetDC(NULL);
int result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char*)&frameBufferInfo);
if(result>0)
{
m_UseRAW=true;
return;
}
rcp wrote:Using GAPI will force the display back to 'emulation' mode... which in your case would cancel out the rotation. On VGA screens, it either pixels doubles or actually changes the display mode. Thus we try not to use GAPI on the newer devices. We use raw access via the ExtEscape or just use the GDI. The newer devices are so much faster that we found you can use the GDI and still coast by on performance.


Thanks!
Eeek - I'm so out of it... by about 4 years!!

So this is how things are done now hey? - ExtEscape... nice!
When I get a chance I'll update PicoDrive