Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

New pockethal 1.0.4 on "old" pocketfrog


New pockethal 1.0.4 on "old" pocketfrog

Postby EvilMaio » Feb 13, 2008 @ 10:21am

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: Select all









10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
void Game::DeviceToLogical( Point& P ) const
{
    switch (m_config.orientation)
    {
    case ORIENTATION_ROTATE90CCW:
        swap( P.x, P.);
        P.= SystemScreenWidthMin1 /*319*/ - P.x;
        break;
    case ORIENTATION_ROTATE90CW:
        swap( P.x, P.);
        P.= SystemScreenHeightMin1 /*239*/ - P.y;
        break;
    case ORIENTATION_ROTATE180:
        P.= SystemScreenHeightMin1 /*239*/ - P.x;
        P.= SystemScreenWidthMin1 /*319*/ - P.y;
        break;
    }

}
19 lines; 9 keywds; 0 nums; 50 ops; 0 strs; 4 coms    Syntactic Coloring v0.4 - Dan East  



Code: Select all









10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
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;

    }
}
27 lines; 33 keywds; 0 nums; 116 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  


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.
User avatar
EvilMaio
pm Member
 
Posts: 45
Joined: Apr 26, 2005 @ 3:05pm


Postby EvilMaio » Feb 22, 2008 @ 1:08pm

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
User avatar
EvilMaio
pm Member
 
Posts: 45
Joined: Apr 26, 2005 @ 3:05pm


Postby jaguard » Feb 22, 2008 @ 10:09pm

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..
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby EvilMaio » Feb 22, 2008 @ 10:15pm

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 ;)
User avatar
EvilMaio
pm Member
 
Posts: 45
Joined: Apr 26, 2005 @ 3:05pm


Postby jaguard » Feb 22, 2008 @ 11:32pm

That's cool, looking forward for this. Never have time to do this myself :(
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Test results

Postby EvilMaio » Feb 22, 2008 @ 11:41pm

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: Select all









10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
//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.);
        P.= 319 - P.x;
        break;

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

    case ORIENTATION_ROTATE180:
        P.= 239 - P.x;
        P.= 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
}

63 lines; 47 keywds; 6 nums; 166 ops; 0 strs; 5 coms    Syntactic Coloring v0.4 - Dan East  



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 ;)
User avatar
EvilMaio
pm Member
 
Posts: 45
Joined: Apr 26, 2005 @ 3:05pm


Postby jaguard » Feb 23, 2008 @ 12:03am

This is very cool indeed! Thanks.

I only wonder what will I get on VGA devices with HI_RES_AWARE flag on.
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby EvilMaio » Feb 23, 2008 @ 12:14pm

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.
Attachments
aram_tests_with_pocketfrog_remap_disabled.zip
(190.5 KiB) Downloaded 372 times
User avatar
EvilMaio
pm Member
 
Posts: 45
Joined: Apr 26, 2005 @ 3:05pm


Postby jaguard » Feb 24, 2008 @ 1:48am

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.
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby EvilMaio » Feb 24, 2008 @ 11:33am

Here is the version with HI_RES flag activated ;)

Daniele
Attachments
tests_noremap_hires_flag.zip
(189.32 KiB) Downloaded 355 times
User avatar
EvilMaio
pm Member
 
Posts: 45
Joined: Apr 26, 2005 @ 3:05pm


Postby jaguard » Feb 24, 2008 @ 12:09pm

I confirm - works perfectly fine in true VGA mode on my ipaq h4700. Awesome!!
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby EvilMaio » Feb 24, 2008 @ 12:34pm

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.
User avatar
EvilMaio
pm Member
 
Posts: 45
Joined: Apr 26, 2005 @ 3:05pm


Postby jaguard » Feb 24, 2008 @ 10:49pm

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.
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


Postby Dan East » Feb 25, 2008 @ 12:48am

FWIW, all four exes rendered properly on a VGA Dell Axim X50v.

Dan
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby ml » Feb 27, 2008 @ 2:44am

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?
ml
pm Member
 
Posts: 30
Joined: Oct 7, 2005 @ 4:22pm


Next

Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron