PocketMatrix forums

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

TrueVGA stylus

Betatesters that tested my !PyroManiA!(based on PF0.8.1 and PH0.7.5) game have some problems (on HP 4700 and Dell X50v, as I know) running it in TrueVGA - even the game is fullscreen'ed(320*240 to 640*480) the mappings for stylus are 640*480.

How to avoid this problem?

Maybe just detect that game is running in TrueVGA and divide stylus coordinates.
But how to detect, does anybody know any function?

Post Modified:
As I found in some of the previous posts:
GetSystemMetrics() with SM_CXSCREEN and SM_CYSCREEN

Or something new to PHal 0.7.5?
BIGBEN wrote:
Post Modified:
As I found in some of the previous posts:
GetSystemMetrics() with SM_CXSCREEN and SM_CYSCREEN

Or something new to PHal 0.7.5?


I took that solution, detecting VGA mode and scaling stylus coordinates to fit them. AFAIK 0.7.x hasn't got that fixed, but 0.8 should :)
In 0.7, what I do is use a boolean, something like "bTrueVGA". Initialize it to false.

In StylusDown, the first time the stylus' x > 239 or y > 319, you'll know you're in True VGA mode. (bTrueVGA = true;)

Then in the stylus events (StylusUp, StylusDown, StylusMove):

if(bTrueVGA)
{
// divide x and y by 2 (using bit-shifting of >>1 is really easy)
}

-John
Is this problem specific to the phal version of pocketfrog? Or are all versions affected?

Also, this only happens if the user has forced vga operation via some hack, right?
fast_rx wrote:Is this problem specific to the phal version of pocketfrog? Or are all versions affected?

I use PFrog0.8.1 on top of PHal0.7.5.
Don't know about PHal0.7.6 & PHal0.7.6b or previous versions

fast_rx wrote:Also, this only happens if the user has forced vga operation via some hack, right?

One of my testers said that he used seVGA a special program to force trueVGA video mode. Unfortunately I have no trueVGA device to test this program.
You can detect TrueVGA with GetSystemMetrics, which will return these values in TrueVGA.

GetSystemMetrics(SM_CXSCREEN) //480
GetSystemMetrics(SM_CYSCREEN) //640

In normal VGA mode GetSystemMetrics will return 240 and 320 respectively.

You can avoid having to scale down the stylus coordinates if you add this resource to your project.

To add the HI_RES_AWARE resource item to your program

1. From the Insert menu, select Resource.
2. Click the Custom button.
3. Enter CEUX for the resource type.
4. Set the resource data to 01 00.
5. Click the Properties tab.
6. Rename the item to "HI_RES_AWARE", including quotes. (If the quotes are omitted, HI_RES_AWARE will be incorrectly defined as a numeric value in resource.h, and you will need to go back and delete the line from resource.h.)
7. Deselect the external file checkbox.

Taken from this link.
http://msdn.microsoft.com/library/defau ... reness.asp
GetSystemMetrics(SM_CXSCREEN) //480
GetSystemMetrics(SM_CYSCREEN) //640


I wonder, are this values orientation-aware?

Also, is this a complete VGA-aware sollution? I mean, are there any other issues, related to VGA or maybe WM2003SE?
I want my next game to support VGA naturally.
GetSystemMetrics is WinAPI so it's PocketFrog's orientation aware