PocketMatrix forums

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

PocketHAL for Symbian UIQ

Pejo Software - Per · 18 Jun 2004, 05:28 UTC
I see from your post in the general discussion forum that you have started to think about Palm development. Does this mean you will support Palm before Symbian UIQ?
I'd love to support UIQ... I am unsure what is involved.

I would assume that I need a UIQ device and then Metrowerks' compiler? That seems a little expensive. Serie 60 was nice as the compiler is free.

A UIQ device is around $1000 CDN and for about the same price I can get both the Palm Tungsten T3 + Metrowerks for Palm.

It's not that I don't want to support UIQ, but Palm seems cheaper and is probably more important.

Altough it seems Gapidraw only provides one DLL for all Symbian devices. Maybe it already works? Could you try it and let me know? I would assume you need to use the Eikon framework instead of Akron... But otherwise it could already work as-is.

Any pointers Johan? =)
Pejo Software - Per · 18 Jun 2004, 15:50 UTC
I don't think you need a Metrowerk compiler for UIQ when compiling for target, but then you need a device to test on!
I will see if I can find any time to try PocketHAL as is is now on a UIQ device, I don't have such a device myself but we have such devices at work, but I will not start to work again until august 15 (I have taken some time off to work with my house). My father also have a P900 but he is currently in Portugal watching football (soccer).
OK I downloaded the SDK and it does seem you don't need Metrowerks to compiler for devices. It is needed only for working on the emulator (an alternative is C++ Builder).

The only problem is getting it tested =) Let me know if/when you have access to a device.

If anyone else has one, feel free to introduce yourself =)
[quote]I would assume that I need a UIQ device and then Metrowerks' compiler? That seems a little expensive. Serie 60 was nice as the compiler is free. [quote]

Actually, the UIQ SDK includes a free GCC compiler that you can use. :) So there's no need to rush out and by CodeWarrior for Symbian. Unfortunately SE does not ship an emulator with their SDK, so to debug the UIQ version you still need to buy CodeWarrior. But UIQ is quite similar to Series 60 so you should do fine without it (there are minor differences but they are at application level, not PocketHAL level).

The major difference between UIQ and Series 60 is that most UIQ devices do not use the 32 byte offset that exists on all Series 60 devices. Some UIQ devices such as the Motorola A925 do however.. Quite the mess, to say the least. And there's no simple way of finding out if a device uses the 32 byte offset or not...

Finally, when I'm at it. I would really recommend buying CodeWarrior for Palm to do the Palm port. We tried the free PRC tools but there were really too many issues involved (especially when you need code segments larger than 64kb), that the switch to Codewarrior in our case was more than worth the asking price.
Thanks for your feedback Johan. It is appreciated.

I did find a way to detect the 32 bytes offset, but not whether or not the display is buffered. Maybe you already thought about it and it doesn't work... But here is the theory:

1) Clear the screen with a known color NOT using direct access. i.e. do it with a normal graphic context.

2) Use direct access to read the first 17 pixels (as far as I know you can read them but you don't want to write to them). If they are all of your "known color", then there is no offset. If the first 16 pixels are something else and the 17th pixel is your "known color", then you have an offset of 32 bytes.

Otherwise, any tricks you can share? =)
Nice one! :)

I'll see what I can dig up. :) At the moment my best tip would be to checkout gapiapplication.h in the include\symbian folder for GapiDraw, which has all the #ifdef options for Symbian and UIQ. It has been tested on both the P800 and the P900. You could probably use that info to create UIQ-compatible apps with PocketHAL without access to an actual device since it also deals with some special cases where the lid is opened and closed.

We have lots of info on the Palm later, but I think it's easier if you just post here or email us if there should be anything, and we can take it from there.. We ourselves got help from the Snails team with Palm design ideas (thanks a lot guys!), so we have no issues in passing along any information.
How do you detect UIQ (non-buffered display) vs Serie 60 (buffered display) at run-time? Or is this handled in the GapiApplication code you provide with the library?
We put that code into the gapiapplication framework. We have a file gapidevice.h where the user can override the default UIQ / Series 60 settings for a specific device (as I guess there is no guarantee that future UIQ devices, if there will be any now that Nokia has ~60% of Symbian, will be direct display devices). We spent quite the time to try to find out whether or not a display is buffered, but Nokia has chosen not to publish much documents on this to market their own NGage game development kit, and Sony Ericsson does not seem interested in the game market at all for their UIQ devices (which is perhaps understandable, given that the P800/P900 in fullscreen mode only have the up/down/tilt left/tilt right rocker on the side as an input device).

All Nokia documents and samples assume that buffering is required. All SE documents assume direct access is possible.

Please feel free to prove that I'm wrong, it would be nice to at least know that there is a solution.
I unfortunately don't think there is a solution. Anything that involves using the windows server just won't work. So to solve this you actually need a way to access the real hardware video buffer, if it is even mapped in the address space.

Without having access to the OS SDK, I don't think we can figure it out. And gaining access to that SDK means you have to be a mobile phone operator.

I think the solution you chose for GD makes a lot of sense. The unfortunate downside is that you can't write code that is future-proof unless you assume everything is not buffered. And you certainly don't want to do that on buffered displays as it means triple buffering and slowing down the screen update by 50%.
Pejo Software - Per · 19 Jun 2004, 07:08 UTC
Johan wrote:the P800/P900 in fullscreen mode only have the up/down/tilt left/tilt right rocker on the side as an input device).


You can't use the stylus?
Sorry. I should have added "except for the stylus". However, designing games for 100% stylus input will require some changes to support the Series 60 devices. If the P800/900 had 2 or 3 buttons, cross-platform Series 60 / UIQ games development would be much simpler.
Pejo Software - Per · 20 Jun 2004, 12:22 UTC
Good!
My game is best controlled by the stylus/mouse but for platforms without stylus it is controlled with keys.
I am doing something like this:
Code:
#if defined(WIN32_PLATFORM_WFSP) || defined(SERIES60)
m_gameConfiguration.useKeys=true;
#else
m_gameConfiguration.useKeys=false;
#endif
Pejo Software - Per · 22 Jun 2004, 22:05 UTC
I have compiled a test application for UIQ using PocketHAL.
I currently don't have access to a device but if there is anyone else out there with a P800/P900, Please try it out!
Attachments:
PeJoTest_uiq.zip (21 KB)
The current release 0.7.2 should almost work on UIQ, but you might experience two problems:

1) Flickering - PHAL assumes that the display is buffered (which isn't true of UIQ devices).
2) Offset in the image - PHAL assumes there is a 32 bytes offset when doing direct access, which isn't true of all UIQ devices

I already fixed these two issues on added some UIQ specific optimization for dithrting down to R4G4B4. This will be in release 0.7.3.

Pejo, did you update the sample framework for UIQ (I assume you did). If so, can you send it to me by email?
Pejo Software - Per · 23 Jun 2004, 06:32 UTC
I am not using the sample framework.
My framework has been designed to handle both Series 60 and UIQ. I have no idea if it works on UIQ though!
Pejo Software - Per · 16 Jul 2004, 17:27 UTC
I had the opportunity to test on a P900 today and my test app seemed to work.
I did not notice any flickering but I did not expect that because my test app is very static.
I just finished the UIQ version of PocketHAL and it runs very well in the emulator.

I do not have access to an actual device for testing... Would you be interested in testing it? I can post the updated PocketHAL here tonight (say in around 10-12 hours).
Pejo Software - Per · 16 Jul 2004, 17:34 UTC
Yes, I can probably do that.
One interesting thing happened last night. I've always read how you need CodeWarrior to work with the UIQ emulator.

Well I just spent 4 hours working with the UIQ emulator using Visual C++ 6.0. I didn't do anything special, it just worked like it does for Serie 60.

Could it be that having both SDKs (UIQ/S60) does that? Or that VC6 is supported but nobody tried it?
A little later then expected, here is a the firework sample for UIQ devices using PocketHAL 0.7.3.

I've tested that it works properly on the UIQ WINS emulator, so I do not expect any problem. If this works, I will be ready to relase 0.7.3.

Let me know!

Regards,
Thierry
Attachments:
firework_uiq.zip (11 KB)
Pejo Software - Per · 20 Jul 2004, 19:20 UTC
8)
It works! At least on a P900.
Awesome! I shall release 0.7.3 tonight!