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?

Anyone running on a windows treo?


Postby fast_rx » Feb 27, 2006 @ 5:30pm

Birdiestyle, pocketFrog was working with square screen devices before this last PHal rev. The problem was specific to the Treo... This was without the HI_RES_AWARE flag (unless you want to run in VGA, I believe).


As for the fix for the stylus orentation mapping, here's what I did (warning, I don't even try to adhere to any variable naming convention):

added to game.h in the private section
Code: Select all

    int styluswidth, stylusheight;
1 lines; 1 keywds; 0 nums; 2 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  


added this to the END of Game::Init in game.cpp
Code: Select all





    stylusheight = m_display->GetHeight();
    styluswidth = m_display->GetWidth();
    if (m_config.orientation == ORIENTATION_ROTATE90CW || m_config.orientation == ORIENTATION_ROTATE90CCW)
        swap( stylusheight, styluswidth );

5 lines; 1 keywds; 0 nums; 26 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  



Changed DeviceToLogical in game.cpp
Code: Select all









10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
void Game::DeviceToLogical( Point& P ) const
{
    switch (m_config.orientation)
    {
    case ORIENTATION_ROTATE90CCW:
        swap( P.x, P.);
        P.= stylusheight - 1 - P.x;
        break;

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

    case ORIENTATION_ROTATE180:
        P.= styluswidth - 1 - P.x;
        P.= stylusheight - 1 - P.y;
        break;
    }
}
20 lines; 9 keywds; 4 nums; 54 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  


It may be no better than just using m_display->GetHeight() in the DeviceToLogical function, but I didn't.



(edit: I didn't have the swap for landscape)

Eventually, I'll get around to submitting a mod to the sourceforge...
User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby Birdiestyle » Feb 27, 2006 @ 6:32pm

Thanks....Im referring to Smartphones with QVGA. Not pocket pc phones with my question? I figured out the Treo stuff for GD and posted in the GD forums originally...

Im hoping we can get one good solid build of PF at some point that we can all go from(the SourceForge was a great idea but I never know where its at and it always seems some things havent quite had time to be added that are really needed).
A <a href="http://www.birdsoft.biz">bird</a> in the hand...
User avatar
Birdiestyle
pm Member
 
Posts: 144
Joined: Nov 8, 2001 @ 5:42pm
Location: Wisconsin


Postby fast_rx » Feb 27, 2006 @ 6:50pm

There's no emulation mode for smartphones that trick the program from thinking it's in 176x220 mode - so why would it need any flag for the resolution?

Don't they have touchscreens? So it seems like any QVGA device would act the same. What am I missing?
User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby Birdiestyle » Feb 27, 2006 @ 7:41pm

Im not sure... I guess, since I was debugging using beta testers and not having the phone, I was unable to determine what exactly was going on. I tried it both ways, but supposedly with GD3.01 It would draw the game images with like a back border around it, or something, though I have QVGA support built in which checks using getsystemmetrics to see if the screen is actually QVGA and should use it completely.... Maybe PH/PF has always supported this correctly, thats what Im asking I guess...

???
A <a href="http://www.birdsoft.biz">bird</a> in the hand...
User avatar
Birdiestyle
pm Member
 
Posts: 144
Joined: Nov 8, 2001 @ 5:42pm
Location: Wisconsin


Postby Kzinti » Feb 28, 2006 @ 12:15am

Birdiestyle wrote:Thanks....Im referring to Smartphones with QVGA.


Smartphones don't have an emulation layer like Pocket PCs do. Using the HI_RES_AWARE flag does nothing on a QVGA Smartphone. The display is always reported as 240x320, even through GAPI.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Birdiestyle » Feb 28, 2006 @ 12:45am

Good enough.. Must be a GD 3.01 problem then?!?!

Thanks
A <a href="http://www.birdsoft.biz">bird</a> in the hand...
User avatar
Birdiestyle
pm Member
 
Posts: 144
Joined: Nov 8, 2001 @ 5:42pm
Location: Wisconsin


Postby Presto » May 18, 2006 @ 10:07pm

So, does anyone here have a Treo 700w?

I don't know for sure yet, but I'm guessing that when it compresses the 240x320 pixels into 240x240, it's skipping one of the rows. I wrote a tiny program that shows the following image. If any of the colors turn out to be solid, we'll know which row it's skipping. I doubt it's a smooth rescaling, since one of my customers reported that the text appeared rather grainy. The setup program is here: http://www.pocketadventures.com/TreoTest_Setup.exe

Thanks,
-John
Attachments

[The extension gif has been deactivated and can no longer be displayed.]

User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Postby Presto » May 30, 2006 @ 6:48pm

Well, as an FYI, here's what happens on the Treo 700w when it resizes a 240x320 GAPI application. It does a pixel averaging on rows 0&1, 4&5, 8&9, 12&13, etc, and leaves the other rows as they are. The results look like this (before and after):

Image Image
User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Postby BIGBEN » May 31, 2006 @ 8:21am

Thank you very much Johan for your contribution! My tester is still silent.

You tested the latest PocketHal (that was to fix this problem)? So the problem is still open. :?
User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Postby Kzinti » May 31, 2006 @ 8:33am

No, PocketHAL is fixed. PocketHAL will report a 240x240 display on the Treo. Presto mentionned he was using GAPI.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby BIGBEN » May 31, 2006 @ 8:43am

Mmm... strange, I'll doublecheck that I've correctly rebuilt the PocketFrog lib (I'm sure I did), since my Treo user reported problems with latest !PyroManiA! demo (uses the latest PocketHAL).
User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Postby Kzinti » May 31, 2006 @ 4:34pm

PocketFrog might not work properly for stylus input.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Presto » May 31, 2006 @ 6:51pm

If you add the Palm Treo 700w to pocketpc.cpp
Code: Select all

    { PocketPC::MODEL_TREO_700W,        _T("Palm Treo 700w") },
1 lines; 0 keywds; 0 nums; 8 ops; 1 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  

and pocketpc.h
Code: Select all

        MODEL_TREO_700W,
1 lines; 0 keywds; 0 nums; 1 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  

then add the following function to game.cpp
Code: Select all








bool Game::IsTreo()
{
#if defined(FROG_PPC)
  return (PocketPC::GetModel() == PocketPC::MODEL_TREO_700W);
#else
  return false;
#endif
}
8 lines; 8 keywds; 0 nums; 20 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  

and game.h
Code: Select all

    bool IsTreo();
1 lines; 1 keywds; 0 nums; 3 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  

Then you can call IsTreo() from your derived game class and save the result in a boolean at initialization.
Code: Select all





bool MyGame::GameInit()
{
  srand(::GetTickCount());
  bTreo = IsTreo();
  ...
5 lines; 1 keywds; 0 nums; 19 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  

Then, in your StylusUp(), StylusDown() and StylusMove() functions you can use something like:
Code: Select all







void MyGame::StylusDown(Point stylus)
{
  if(bTreo)
    pScreenMgr->StylusDown(Point(stylus.x, (stylus.y*4)/3));
  else
    pScreenMgr->StylusDown(stylus);
}
7 lines; 3 keywds; 2 nums; 27 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  
User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Postby fast_rx » May 31, 2006 @ 9:49pm

I did not have to scale the stylus after PHal was changed to give you a 240x240 display... Or are you saying you're letting it run in compatibility mode and need to scale the stylus?

The only changes I made was to get rid of the hardcoded 240's and 320's in the device to logical functions I mention above, and everything was reported to work fine by the beta tester.


Isn't there more 240x240 devices coming out? I'm wondering how many of them are going to cause problems.
User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby jaguard » May 31, 2006 @ 10:23pm

I wonder, is there actually a whole solution for square devices?
As far as I see:
In treo 700w we set hires aware flag and getting nice 240x240 screen. In hp 63xx we don't set anything and get this 240x240 screen right away. So, I should have two versions, totally equal, except for this hires aware flag? OMG..

That funny Palm. These guys always manage to cause maximum problems to developers :).
jaguard
pm Member
 
Posts: 230
Joined: Mar 2, 2004 @ 6:45pm


PreviousNext

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