PocketMatrix forums

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

PocketHAL 0.7.0 for Symbian Serie 60

There is some technical issues preventing me from updating my web site at the moment, so I decided to post it here... The first Symbian version of PocketHAL!

The API is mostly unchanged from 0.6.5. Surfaces now have a static constructor "Surface::Create()". This was needed to properly return NULL when surface creation fails. From now on, all classes that can fail will use a static constructor.

PocketHAL for Symbian only supports one orientation: ORIENTATION_NORMAL.

A "minimal" sample is provided to get you going. The sample will clear the screen alternating between two colors: green and red. A ready to install .SIS file is provided in the archive.

GetClock() on Symbian is limited to a resolution of 1/64th seconds. The returned value is still in milliseconds. Note that GetClock() on the emulator (WINS) also runs at a resolution of 1/64th seconds to properly emulate real devices.

Sorry, PPC and desktop librairies are not available in this release. They should be available shortly.
Attachments:
PocketHAL_0_7_0_Symbian.zip (55 KB)
great :) I have to get my series 60 phone in two days, is it working on all series 60 devices?

btw, which is the way to insert asm in symbian? I worked a long time ago with it and I found no way to do it.

Kak-
Thierry wrote:

GetClock() on Symbian is limited to a resolution of 1/64th seconds.


Is it an hardware or an OS limitation ?
Anonymous wrote:great :) I have to get my series 60 phone in two days, is it working on all series 60 devices?


It should work on all Serie 60 devices.

Anonymous wrote:btw, which is the way to insert asm in symbian? I worked a long time ago with it and I found no way to do it.


That's what I am investigating right now... I'll let you know what I find.
StephC":spqj1ist]

It is an OS limitation. From what I could find, there is a kernel-side timer with a 1 ms precision. But there is no way to access it from the client-side of the OS. This means that the available presision is 0.015625 seconds. Probably enough for most games, but just a pain when trying to profile things.
Thierry wrote:
It is an OS limitation. From what I could find, there is a kernel-side timer with a 1 ms precision. But there is no way to access it from the client-side of the OS. This means that the available presision is 0.015625 seconds. Probably enough for most games, but just a pain when trying to profile things.


I hope that it's possible to get access to a low level (hardware) timer, 1/64th of second is a very inconvenient value...
I found an assembly tutorial for Symbian 60:

http://www.hipergames.com/symbianasmch1.html
Thierry wrote:
I found an assembly tutorial for Symbian 60:


lots of thanks, it'll become really handy :)
Pejo Software - Per · 07 May 2004, 22:03 UTC
I just have just converted my framework to Symbian and everything works (on my Nokia 6600)!
I had to remove your definitions of memcpy and memset since they are already defined in string.h.

A tip to everyone thinking of building for Symbian:
Don't beleive your code will work just because it does on the emulator. When building for the emulator you actually build for windows and there can be lots of things that would not work when compiling for target.
I spent some time implementing image loading with libpng and it worked great on the emulator but when I switched to compile for target I realized that I would never get that to work! So instead I had to use some obscure Symbian image loader.
Pejo: I will move memcpy() / memset() to the PHAL namespace. I though they already were.

Concerning PNGLIB: what kind of problems did you encounter? The Symbian builtin functionality will load to a CFbsBitmap (I think) and I am not sure I like this.
Pejo Software - Per · 07 May 2004, 22:37 UTC
Thierry wrote:Concerning PNGLIB: what kind of problems did you encounter? .

It just wouldn't compile!
When compiling for the emulator the only thing I needed to change was that libpng shouldn't allocate too much on the stack but when I tried to compile for target there were all kinds off troubles. Also since I am building an app I can not use global or static variables and I beleive libpng uses this.

Regarding the Symbian built in loading (CMdaImageFileToBitmapUtility): Yes it will load to a CFbsBitmap so you need to use more memory than with libpng but your code size will on the other hand be smaller.
Pejo Software - Per · 20 May 2004, 17:08 UTC
Will version 0.7 be available for Pocket PC any time soon?
Pejo Software - Per wrote:Will version 0.7 be available for Pocket PC any time soon?


I am currently hard at work on it. I am trying to write a thin framework that will allow you to easily write for all platforms without having to know the details. And the Symbian part is a nightmare to get right. The main reason I do this is so that I can provide cross-platform samples. Of course this framework will come in handy to lot of developers.

Then there is the matter of integrating all the PHAL 0.6.x branch optimizations into the 0.7.x branch (that is quite different). Unfortunately the pre-0.7 architecture of PHAL didn't allow for an easy port to Symbian and I had to rework most of it.

I would also like to provide an installer, mostly for Symbian... Installing PHAL on Symbian isn't trivial when you are new at it and I want to ease to pain for new developers.

And then there is optimizations for Symbian... And requests I get all the time from donators/licensees for custom versions. These usually take precedence to all of the above.

And to add some injury: I can't debug on the PPC emulators anymore (it just won't work) and connections to actual devices si flacky/slow as hell. I spent 2 hours setuping my laptop with EVC3/EVC4/ActiveSync thinking that it would solve all of my problems... And it suffers from the same symptoms. There is something I can't figure out.

As you can see, I am quite busy =)
Pejo Software - Per · 20 May 2004, 19:38 UTC
Thierry wrote:I am trying to write a thin framework that will allow you to easily write for all platforms without having to know the details.

Does this mean that the focus of PocketHal has shifted from being a way of accessing the display towards a complete cross platform framework.
For me the framework is not important since I have my own and also the sample you provided for Symbian was enough to start using PocketHal on Symbian.

My own framework have only one class that you derive from and it works the same on all platforms. Only one thing more is required and that is calling the macro DEFINE_APP_ENTRYPOINTS which for Win32 will create WinMain and for Symbian it will create NewApplication and E32Dll and so forth.

One problem that I had to deal with when starting to port the game I am developing was that I needed to write my own micro STL implementation. So now that this has been done and I have added this into the Pocket PC version of my game I wanted to use my new version of the framework that works as described above but since PocketHal 0.7 isn't available for Pocket PC this is perhaps not the easiest route. I guess I need to go to Symbian directly.

Anyway, thanks for your efforts! I will donate something if I release anything using PocketHal. I am not sure I ever will finish my current game since we will have our second child in about a month.
PocketHAL will stay a frame-buffer access library and won't impose you to use any framework. PocketHAL has some success because of this and it would be foolish to change this aspect.

In fact the framework I am talking about is not part of the library itself but resides in a "\samples\common" directory. This framework will probably slowly evolve into the next PocketFrog. That's the way I see things now.

But rest assured that the PocketHAL API wll stay the way it is now, or at least something really close.
its been awhile since i checked on PHAL. and now symbian support. wow wow wow !!

there was a discussion before on which platform to support first (Palm,Symbian,etc...) i guess Symbian is first. great!
Pejo Software - Per · 26 May 2004, 09:09 UTC
Is PocketHAL for Symbian using the active scheduler?
Pejo Software - Per wrote:Is PocketHAL for Symbian using the active scheduler?


PocketHAL doesn't internally use the Active Scheduler. It leaves the flexibility of using it or not in the end of the programmer.

The samples that will ship with 0.7.2 will demonstrate how to use PHAL in the context of the Akron framework, which does use the Active Scheduler.

0.7.2 is code complete, I now need to conduct some testing to make sure everythings work properly.
Pejo Software - Per · 26 May 2004, 16:48 UTC
OK, I asked because I had some problems with loading larger images, because of some inteferance from PocketHAL, but I got it working now by rearranging some code.
So now my game runs on my Nokia 6600 :) .

A couple of problems:
It takes a very long time to load my images and the PocketHAL splash screen is never shown.
The movement in the game is a little jerky and I beleive this is because of the inaccuracy of time measurement. If you somehow could find a way to make this more accurate it would be great, and that sound like a perfect job for you :wink: .
Make sure that when you load images you do not starve the Active Scheduler. This has nothing to do with PHAL (it doesn't load images as far as I know =)

Thanks for the tip concerning the splashscreen.

As for more precision in the timer... I will of course investigate, but it doesn't look good. But then again I have some ideas to try.