PocketMatrix forums

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

New pockethal 1.0.4 on "old" pocketfrog

Hi Thierry,

i saw you released a new pockethal version; that's always cool news :)

I'm using new pockethal 1.0.4 on latest pocketfrog, available from site and i saw you fixed several orientation issues.

Now I wonder what we have to do with pocketfrog functions which deal with input remapping..

I mean, there's two remapping function inside latest pocketfrog (game.cpp) (please ignore if they're slightly different from original, because there is a small patch of mine...)

Code:
void Game::DeviceToLogical( Point& P ) const
{
switch (m_config.orientation)
{
case ORIENTATION_ROTATE90CCW:
swap( P.x, P.y );
P.x = SystemScreenWidthMin1 /*319*/ - P.x;
break;
case ORIENTATION_ROTATE90CW:
swap( P.x, P.y );
P.y = SystemScreenHeightMin1 /*239*/ - P.y;
break;
case ORIENTATION_ROTATE180:
P.x = SystemScreenHeightMin1 /*239*/ - P.x;
P.y = SystemScreenWidthMin1 /*319*/ - P.y;
break;
}

}



Code:
void Game::DeviceToLogical( int& button ) const
{
#if defined(_WIN32_WCE)
switch (m_config.orientation)

{
case ORIENTATION_ROTATE90CCW:
if (button == m_keys.vkUp) button = m_keys.vkRight;
else if (button == m_keys.vkLeft) button = m_keys.vkUp;
else if (button == m_keys.vkDown) button = m_keys.vkLeft;
else if (button == m_keys.vkRight) button = m_keys.vkDown;
break;
case ORIENTATION_ROTATE90CW:
if (button == m_keys.vkUp) button = m_keys.vkLeft;
else if (button == m_keys.vkLeft) button = m_keys.vkDown;
else if (button == m_keys.vkDown) button = m_keys.vkRight;
else if (button == m_keys.vkRight) button = m_keys.vkUp;
break;
case ORIENTATION_ROTATE180:
if (button == m_keys.vkUp) button = m_keys.vkDown;
else if (button == m_keys.vkLeft) button = m_keys.vkRight;
else if (button == m_keys.vkDown) button = m_keys.vkUp;
else if (button == m_keys.vkRight) button = m_keys.vkLeft;
break;

}
}


Does new pockethal 1.0.4 handle remapping by itself, so we should comment these two functions? Or should be left untouched?

Thanks in advance for your time!!

Regards.
Any clue? :(

I know that pocketfrog hasn't been updated for a while, but i think there are lot of people which still use it with pockethal :D
No clue. Because of these issues, I'm still on older Pockethal. Looks like we're only two who still actually visits this forum and uses pocketfrog..
Too bad :(

Later i will do some tests; i'm going to try to use a patched pocketfrog and latest pockethal commenting out all input remapping code; then i'll try to get input coordinates and buttons with and without pocketfrog's remapping routines.I'll do this test for all available pockethal/device orientations combinations..

I'll keep you informed about results ;)
That's cool, looking forward for this. Never have time to do this myself :(
EvilMaio · 22 Feb 2008, 22:41 UTC — Test results
Ok, i made several tests and finally found the light at the end of the tunnel!!

I can confirm that using latest pockethal (1.0.4) with input remapping routines fixed by phal itself, we can disable pocketfrog framework remapping routines (because this would cause a conflict and the final coordinates/buttons would be broken again!)

Actually, remapping routines are done by pockethal, so we can comment them from pocketfrog. In shorts, what we have to do is comment functions inside source\framework\game.cpp from pocketfrog sources.

Remember, this is only if you use latest pockethal 1.0.4 and latest pocketfrog 0.8.1!!


Code:

//fixme: don't use hard coded values for width and height
void Game::DeviceToLogical( Point& P ) const
{
// remapping is now done internally by pockethal 1.0.4
// so we can comment this!
#if 0
switch (m_config.orientation)
{
case ORIENTATION_ROTATE90CCW:
swap( P.x, P.y );
P.x = 319 - P.x;
break;

case ORIENTATION_ROTATE90CW:
swap( P.x, P.y );
P.y = 239 - P.y;
break;

case ORIENTATION_ROTATE180:
P.x = 239 - P.x;
P.y = 319 - P.y;
break;
}
#endif
}

void Game::DeviceToLogical( int& button ) const
{
// remapping is now done internally by pockethal 1.0.4
// so we can comment this!
#if 0

#if defined(_WIN32_WCE)

switch (m_config.orientation)
{
case ORIENTATION_ROTATE90CCW:
if (button == m_keys.vkUp) button = m_keys.vkRight;
else if (button == m_keys.vkLeft) button = m_keys.vkUp;
else if (button == m_keys.vkDown) button = m_keys.vkLeft;
else if (button == m_keys.vkRight) button = m_keys.vkDown;
break;

case ORIENTATION_ROTATE90CW:
if (button == m_keys.vkUp) button = m_keys.vkLeft;
else if (button == m_keys.vkLeft) button = m_keys.vkDown;
else if (button == m_keys.vkDown) button = m_keys.vkRight;
else if (button == m_keys.vkRight) button = m_keys.vkUp;
break;

case ORIENTATION_ROTATE180:
if (button == m_keys.vkUp) button = m_keys.vkDown;
else if (button == m_keys.vkLeft) button = m_keys.vkRight;
else if (button == m_keys.vkDown) button = m_keys.vkUp;
else if (button == m_keys.vkRight) button = m_keys.vkLeft;
break;
}

#endif

#endif
}




Tested configurations: all combinations of application / device orientation:

1) application normal - windows portrait
2) application rotated 90cw - windows portrait
3) application rotated 90ccw - windows portrait
4) application rotated 180 - windows portrait
5) application normal - windows landscape
6) application rotated 90cw - windows landscape
7) application rotated 90ccw - windows landscape
8) application rotated 180 - windows landscape

In all 8 cases, the buttons and stylus were ok !!

Tested on Asus Mypal A636.

p.s: remember to recompile pocketfrog for win32/pocketpc after patching it ;)
This is very cool indeed! Thanks.

I only wonder what will I get on VGA devices with HI_RES_AWARE flag on.
I really don't know, if someone with VGA device wanna test...here's the 4 exe i used to test stylus/button pocketfrog input with remapping disabled ;)

Regards.
This does work allright, but the device is in QVGA mode, and it reports QVGA coordinates.
You didn't switch it to HI_RES_AWARE mode.
here's the instruction:

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.
Here is the version with HI_RES flag activated ;)

Daniele
Attachments:
tests_noremap_hires_flag.zip (190 KB)
I confirm - works perfectly fine in true VGA mode on my ipaq h4700. Awesome!!
Great ;)
Thanks for your test.

I'll make this fix permanent on my PFrog sources.


It would be very cool if also official sources would be patched for latest phal 1.0.4 ;)

This could be a proposal for sourceforge pfrog page mantainer (fzammetti as far as i remember :))

Regards.

Daniele.
It would be very cool if also official sources would be patched for latest phal 1.0.4


Yep, but sadly the project is dead for a several years now. Let's just hope microsoft doesn't come up with something that will require a massive rework on Pfrog.

This could be a proposal for sourceforge pfrog page mantainer (fzammetti as far as i remember )


It was never actually updated as far as I remember.
FWIW, all four exes rendered properly on a VGA Dell Axim X50v.

Dan
jaguard wrote:No clue. Because of these issues, I'm still on older Pockethal. Looks like we're only two who still actually visits this forum and uses pocketfrog..


not true - it's 3! but it's been a while. I still use PF / PH but I spent so much time trying to fix the orientation myself, I couldn't bear to take the latest version and work out again what to leave out of my code to keep it working the same way.

If Thierry would release as open source, I'd happily release my GUI library (with transparency effects and most common controls supported eg windows, buttons, checkboxes, listboxes, treeviews, images boxes, scroll bars, + additional blitters for scaling, masked fonts, packaged compressed virtual file system etc.) as well to support the cause. I'm not sure what Thierry hopes to gain by keeping the source code so guarded. At some point won't all MS Pda's be hardware accelerated, so need for PHAL might go away? We're approaching that transition period now aren't we? I use PHAL & PFrog becuase I know I get consistent results with a few exceptions. It's the only choice without shelling out $1000's for a restrictive license.

Can't we create some collaboration that will serve the need of the community in a better way?
This is correct. The code in DeviceToLogical() isn't needed anymore when using the newer PocketHAL.