PocketMatrix forums

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

PocketHal in 2003SE

I have had a tester try out yeti on a dell axim, starting from landscape mode. His comments:

"when you enable landscape mode and then run the game, it switches itself to portrait mode BUT the keys are mapped like it was still landscape."

Any idea how I can handle this? I can think of a few hacky ways, but nothing elegant.

It's good that it works all though given the problems others are having.

Ta
I had posted something about that a couple of days ago.

One thing I forgot to mention is that I'm compiling to a target of 2002 with evc3.

I doubt using 4 with a 2003 build would make any difference, but I haven't tried. What are you using?
I'm using Visual Studio 2005 Beta 1, compiling to ARM/ PPC 2003.
Here is a release candidate for the next build. I have fixed the input orientation issue on WM2003 SE. If one (or both of you) could test this version and let me know that it works properly, then I will be able to release it.
Attachments:
PocketHAL_ARM_0_7_4_RC1.zip (44 KB)
I have sent it off to my tester.

Should it have a watermark?
Yes, it will have the 0.7.4 watermark.
OK, another rebuild and I have sent it off.

One thing I noticed, it doesn't seem to respect the SetViewport settings on the ppc.

On the plus side, this did enable me to fix a flaw in my drawing :)
Mr X wrote:One thing I noticed, it doesn't seem to respect the SetViewport settings on the ppc.


What do you mean by that? What is the device being tested? What happens and what should happen?
The device is a ipaq 2210. I have a view port of 240 wide and 180 high, starting from the top left. phal should only copy this area.

There was a flaw in my drawing logic, that was drawing full screen. With the old phal, only the top was was copied (correct). With the experimental version, the ertire screen was copied despite the view port setting so I was seeing graphics in the bottom part of the screen.

This only happened on the ipaq, the windows version has no such problem.

If you want, I can post a version that demonstrates the problem. It will be a 2 meg download.
Nothing has changed between 0.7.3 and 0.7.4 concerning the viewport. Are you sure you didn't change something on your end?

I myself use the iPAQ 2210 for testing WM2003.
See http://www.intuitex.com/download/yetiTest.zip.

The only differece between the two is the phal lib. 073 is fine, 074 displays garbage below my view port.

I am not setting the view port every swap. Could that be the problem?
Thierry wrote:If one (or both of you) could test this version and let me know that it works properly, then I will be able to release it.


Hmmm... I suppose I just replace the phal lib and do a rebuild all on my project, right... no need to rebuild pocketfrog itself.

I do get the new banner saying 0.7.4, but it acts the same as 0.7.3 did. The controls are 180 degrees from where they should be - not 90 degrees like you'd expect - assuming you didn't do anything to remap them.

I know this is confusing, let me try and explain.

in 'landscape right handed'
physical UP on the dpad is now really right, but you want to 'un-do' what the rotation did since we want to stay in portrait mode. It should be remapped to UP, but instead it is LEFT.
Mr X wrote:See http://www.intuitex.com/download/yetiTest.zip.

The only differece between the two is the phal lib. 073 is fine, 074 displays garbage below my view port.

I am not setting the view port every swap. Could that be the problem?


The SetViewport() will be ignored until the watermark has finished displaying. If you only set it once at the beginning, then this can explain your problem.

What you see at the bottom doesn't look like garbage. If you move left/right, you will see stars moving left/right. Doesn't appear random at all.
fast_rx wrote:Hmmm... I suppose I just replace the phal lib and do a rebuild all on my project, right... no need to rebuild pocketfrog itself.
Exactly.


fast_rx wrote:I do get the new banner saying 0.7.4, but it acts the same as 0.7.3 did. The controls are 180 degrees from where they should be - not 90 degrees like you'd expect - assuming you didn't do anything to remap them.


I did remap them. That's what I am trying to fix. I might have confused left and right rotations.

fast_rx wrote:I know this is confusing, let me try and explain.

in 'landscape right handed'
physical UP on the dpad is now really right, but you want to 'un-do' what the rotation did since we want to stay in portrait mode. It should be remapped to UP, but instead it is LEFT.


You bet it is confusing. That's why I needed someone to test it for me. I probably rotated the keys the wrong way, hence the 180 rotation you now see.

Note that I can't change the key code that WinCE sends to the app. What I do is change the values for the directions in the KeyList structure.

Here is RC2, I inverted the keys rotation. Let me know how it goes.
Attachments:
PocketHAL_ARM_0_7_4_RC2.zip (44 KB)
No difference... 0.7.3, and both 0.7.4s act the same.

I should just be using code like this in the ButtonDown() function, right:
if(button == keys.vkUp) ...
fast_rx wrote:No difference... 0.7.3, and both 0.7.4s act the same.

I should just be using code like this in the ButtonDown() function, right:
if(button == keys.vkUp) ...


That's right. Can you trace down in PF where GetKeyList() is called? What is the specified orientation?

If it doesn't work, it probably means I am not properly detecting the current screen orientation. I've been trying to download the WM2003 SE emulator for a few days now, but www.pocketpc.com is always down =(.

edit: crap, I know exactly why it doesn't work. This will have to wait till tonight (in 8-9 hours).
Good thing you weren't asking me to debug the app - since I've never gotten around to getting evc3 to talk to the dell axim. It says something like platform manager failed to connect...

Does anyone know if it's possible to use a 2003 device with evc3? I could step up to using evc4, but I'd rather not.
Heard back from my tester.

"When run in landscape it still self-rotates to portrait with keys mapped like to landscape. So pressing left does step-back, up does rotate-left, etc"

The stars are not random, they were drawn in error :-(. Thanks for explaining the stviewport thing.
fast_rx, can you go to function Game::Init() in file.cpp. Toward the end, you have:

Code:

// Init input
if (!PHAL::GetKeyList( &m;_keys, m_config.orientation ))
return false;

// In case ORIENTATION_UNKNOWN was selected
m_config.orientation = m_display->GetOrientation();


Can you change it to:

Code:

// In case ORIENTATION_UNKNOWN was selected
m_config.orientation = m_display->GetOrientation();

// Init input
if (!PHAL::GetKeyList( &m;_keys, m_config.orientation ))
return false;


...and let me know the results?

I got confirmation that the screen orientation is properly detected in PHAL 0.7.4. So maybe something is wrong in PocketFrog when calling GetKeyList(). If this doesn't solve it, could you use different orientations as the second parameter to GetKeyList() and see if it affects the results?

Thanks,
TT
Mr.X, fast_rx, others:

Here are two other RC you can test. They detect the screen orientation in a different way and this might well fix the issue.

One rotates the keys one way, the other the other way. This way we can save time on the turn around with your testers.
I tried code changes similar to

Code:
// In case ORIENTATION_UNKNOWN was selected
m_config.orientation = m_display->GetOrientation();

// Init input
if (!PHAL::GetKeyList( &m_keys, m_config.orientation ))
return false;


but that didn't help. I have sent off 2 test exes to my tester. If anyone else wants to try, they are at

http://www.intuitex.com/download/yetiTest.zip (2 meg dl)
Mr X · 24 Aug 2004, 11:41 UTC — We have a winner...
Straight from the horses mouth

74A: looks like left and right have been switched, same with up and down. I mean when you press left, you turn right.

74B: - IT WORKS LIKE IT SHOULD :-)) (I mean it still switches itself to portrait, but keys are mapped fine this time) Chris.
Awesome! We finally made it! =)
I tested PocketHAL_ARM_RC3_B.zip and it worked correctly.

One question though... Is there a way to query the portrait/landscape state so that the program can choose to honor it or ignore it?

Or you could have an extra item in the Orientation enum that was something like USE_CURRENT...

I don't know if I'd use it anyway, just a thought.
fast_rx wrote:I tested PocketHAL_ARM_RC3_B.zip and it worked correctly.

One question though... Is there a way to query the portrait/landscape state so that the program can choose to honor it or ignore it?

Or you could have an extra item in the Orientation enum that was something like USE_CURRENT...

I don't know if I'd use it anyway, just a thought.


I guess it could be added... Not sure if it would be useful to anyone. You usually want your game to run in a pre-determined orientation. Unless you do 3D, in which case you want to default one for fastest performances (ORIENTATION_UNKNOWN).
I assume you can't (or shouldn't) run pocketfrog with an orentation of ORIENTATION_UNKNOWN.

Does that go back to the issues with pre 0.8 frog where I had with writing a blitter that would work with all 4 orientations and a hacked version of frog to add a 'lock with no swizzle' function? (the reason for the no-swizzle was the performance hit of the internal rotate stuff)
fast_rx wrote:I assume you can't (or shouldn't) run pocketfrog with an orentation of ORIENTATION_UNKNOWN.


That is no longer true. You can use ORIENTATION_UNKNOWN with PF 0.8 and it will work.

fast_rx wrote:Does that go back to the issues with pre 0.8 frog where I had with writing a blitter that would work with all 4 orientations and a hacked version of frog to add a 'lock with no swizzle' function? (the reason for the no-swizzle was the performance hit of the internal rotate stuff)


That's right. There is no more sizzling going on, so no need to write 3-4 blitters anymore. Hey GD liked it so much that they decided to add PocketHAL support =)
I guess I need more clarification...

If I initialize PF with ORIENTATION_UNKNOWN, then do something like DrawVGAText(), is the text going to be drawn in the display's native orientation? i.e. sideways on an HP3765, but right-side-up on a e755, etc?

Sorry for my confusion...
fast_rx wrote:If I initialize PF with ORIENTATION_UNKNOWN, then do something like DrawVGAText(), is the text going to be drawn in the display's native orientation? i.e. sideways on an HP3765, but right-side-up on a e755, etc?


Yep.

fast_rx wrote:Sorry for my confusion...


That's why we have this forum.