PocketMatrix forums

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

PocketHAL 0.8 ALPHA

I said soon... And I meant soon =)

You can now download Alpha V3:

www.droneship.com/files/PocketHAL_Alpha_V3.zip

Report back comments/errors/problems here.




Alpha Release
=============

Please take note of the following:

1) Optimizations are not enabled. This version is expected to be slower then 0.7.5 in most cases.
2) The Palm version doesn't have ARM optimizations enabled.
3) Synchronization with the refresh rate (VSYNC) won't work on any device.
4) SetViewport() won't work in most cases (the whole screen will be updated each time).
5) Performances on Palm are very low. This release is for compatibility testing.



Windows:

- DirectX support
- Fullscreen and windowed modes on the PC


Windows CE:

- Fixed crash: Display::Create() would fail on the IPAQ 4350.
- WM2003 SE VGA support
- Added windowed mode support
- If you open a non-hires aware screen in VGA mode (on a VGA device),
the mouse input coordinates won't be scaled properly.


Symbian:

- Display orientation changes now supported on Symbian Serie 60 and
UIQ devices.


Palm:

- New Palm OS support! Color Palm OS 3.5 and above devices are all
expected to work with PocketHAL.
- Minimal Dynamic Area Input (DIA) support is included (ie: it works,
but you can't control the display of the control bar and input area).
- There is no input-related functionality (GetKeyList() doesn't return
any key code and key locking/unlocking is in your hands).
<b>KNOW ISSUES (Palm Alpha V1)
=======================</b>

- SDK 5.2+ is required to compile the samples (should only require SDK 3.5)
- Dependancy on PalmOSGlue: will be removed in the next release

<b>Runs on the following devices:</b>

Treo 600, Treo 650, Tungsten C, Tungsten E, Tungsten T, Tungsten T3, Tungsten T5, Garmin iQue, Zire 31, Zire 71

<b>Does not work on the following devices:</b>

Unexpected graceful exit: Vx
"Fatal Exception": Treo 300
"Unimplemented": m130, m500, m505, m515
Sweet! Now we only need to wait till it stable, and new version of PF to support new features :D :D :D
mortel !! ;)
PocketFrog 0_9_x and new features... PNG alpha channel :o
You know what I'm dreaming about Thierry
:lol:
Anyway Palm support in PHAL is really really great!!! (Even I have no device to try it now)
Waiting for the frog hopping on palm :wink:
You can now download Alpha V2:

www.droneship.com/files/PocketHAL_Alpha_V2.zip

Dependancy on PalmOSGlue has been removed.
Thierry:

You have a idea about the release date for the new PocketFrog ?.

Thanks alots ;-)

Regards.
You can now download Alpha V3:

www.droneship.com/files/PocketHAL_Alpha_V3.zip

PocketHAL is now expected to work on Palm OS 4.x devices. The Palm OS 3.5 problem is being investigated.
fortunately it's weekend and I've been able to test the samples in my Tungsten E & T3 , and minimal work well in them, however firework is only showing a black screen (and the fmrae counter, about 0.5 fps)
is that correct??

btw, are you using a dirty rectangle approach with pockethal palm? I mean most of my ports will be straight from pocket PC (240x320), so I could benefit of a dirty rectangle approach (if not using, it'd be great to have an special mode for ports from pocket PC, giving some extra speed to palms)
javiero wrote:You have a idea about the release date for the new PocketFrog ?.


At this point, I would say it's safe to answer: early next year.
Kak wrote:fortunately it's weekend and I've been able to test the samples in my Tungsten E & T3 , and minimal work well in them, however firework is only showing a black screen (and the fmrae counter, about 0.5 fps) is that correct??


Yes, I am getting the same thing on my Tungsten T3. Performances aren't there yet. All the code is 68K and the whole firework algo will need to be moved to ARM to get it to run properly. I want to concentrate on compatibility first, performances will come later (I am actually already looking into that).

Kak wrote:btw, are you using a dirty rectangle approach with pockethal palm? I mean most of my ports will be straight from pocket PC (240x320), so I could benefit of a dirty rectangle approach (if not using, it'd be great to have an special mode for ports from pocket PC, giving some extra speed to palms)


I am not sure I am following you. Right now the whole screen gets updated and the viewport rect your specify is ignored on Palm. This will of course change in the future.
Thierry wrote:
Yes, I am getting the same thing on my Tungsten T3. Performances aren't there yet.


ok, I wasn't sure if it wasn't working or it just was too slow :)

Thierry":2xvfddg7]


I meant that I (and probably quite a lot of people) will be only using 240x320 instead of the total resolution of 320x320 palms (palm OS 5 at least).
It'd be great if only those 240x320 would be blitted, instead of the whole surface (hence the dirty rectangles question)
I think you did something similar with mediaQ devices, isn't it?


A "new thing", I can't compile the PC version cos I get directx d3d8.lib missing. Will dx8sdk be needed or it's just a temporal problem?

btw, Great work :)
Kak wrote:ok, I wasn't sure if it wasn't working or it just was too slow :)


Don't expect much from 68K code. It will always be slow. Palm sucks, big time.

Kak wrote:I meant that I (and probably quite a lot of people) will be only using 240x320 instead of the total resolution of 320x320 palms (palm OS 5 at least).
It'd be great if only those 240x320 would be blitted, instead of the whole surface (hence the dirty rectangles question)


Yes, setting the viewport will allow you to do just that. It's not in yet but will be.

Kak wrote:A "new thing", I can't compile the PC version cos I get directx d3d8.lib missing. Will dx8sdk be needed or it's just a temporal problem?


A crap. Yes, the new PocketHAL lib links to d3d8.lib for DirectX support. I will see what I can do to remove this dependancy.
ok i've got the time to test beta3 on my toshiba e800.

Good news: it do is in real VGA (yeah !!), we can now use full 480x640 (errata... not "good news" but "excellent news" ;))

Bad news: (sigh) it runs so slow that i can't be used in a game :/

In PHAL 7.5 i got around 40 FPS with fireworks sample, and with PHAL 8.x beta3 it turns around 13 FPS (argh...)

So, Thierry, your first assumptions was right, it's 4 times slower in VGA.

Do you think it could evolve (in the good way ;)) with the next release, or do i have to throw my tosh over the window ? :)
Does other beta-testers have the same frame rate in VGA ? Did i miss something ?

Well, anyway, it's fun to have the possibility to code in VGA, but actually i don't see how to code a game in this way (for GUI for instance, and "static" prg it could do the work)
I don't think it will be possible to speed up VGA rendering in general. You have to keep in mind that Firework does a lot of expensive calculations and that this is proportional to the number of pixels.

Have you tried "Minimal" in VGA mode to see how fast it runs? I am getting 138 FPS on my Toshiba E830.

Although the problem in your case could be the external video chip (Imageon), in which case something might be possible. I've tried contacting ATI multiple times to get access to their API, but they never bothered replying.
i haven't try minimal, but it will be done today.

I don't know if this could help with imageon, but you could check this site : http://www.mnementh.co.uk/eseries/docs/imageon/
Don't know if infos are exact nor where they come from (haven't try/check myself)

For now i need some sleep but i will tell you how it runs with minimal on e800 later this day.
1st of all, sorry for the response lag and for the poor english level : I was burned-out.

Well...
I've compiled/tested minimal on my toshiba e800, here is the result in "real VGA":
~35 FPS without using stylus, ~18 using it all around the screen
(on emulator, and hence without VGA, i got ~190 FPS)

I'm far.. far.. far away of your 130 FPS :/
Damned ! i think about changing my PDA now (and earn some money to ;))

Thierry, have you planned to use ATI imageon hardware on PHAL 8.x ? or do i have to begin to economize my poor geek money ? :cry:
Imageon 100 support will be in soon. That means only for the Toshiba E740 and E750 though. This is based on reverse engineering work done my someone else (Sergey Chaban).

The E800 has a different chip and I have no idea how to program it. Since I am not able to reach ATI for any info, I am afraid there is nothing I can do.

The link you provided earlier is about the Imageon 100 and doesn't have much useful info (ie: it's incomplete).
yep you are right, i was really really burned out : it's written in big chars on the 1st page :)

I can't find the work this guy has done on e800.
He is working on a linux port on this pda, and posts sometimes on brighthand).

Hmmm i feel you are upset with ATI's reaction ('non-reaction' would be more correct), i will try to find some stuff about it, and ask ATI by myself (i was working @microsoft and have some friends there, they could ask for it... maybe it could make things move on)
tssss i should have worked at Toshiba ! :/

-> everything but not buying a new pda for now ! huhu
I will wait the next generation for that.

Anyway, thanks for your work. I will tell you if it's worked or not with ATI. But it's quite stupid in fact... on wich pda is there an ATI imageon 32xx ? only e800 ?? you have no interest to add this stuff to your lib (in my own point of view). I would have appreciate it but i might be the only one to :)

thx again.
I'd love to add support for every single PDA out there. But ATI is the only vendor that don't even bother replying to me. If you can get things moving... That would be awesome.
Hey,

My friend is having an issue on his Ipaq 3700 series with the 'flighdemo' using PocketHAL. The game will not execute and just exit. He even soft reset his device. I'm assuming it is PocketHAL issue coz the file runs smoothly on my device 1910.

Can you investigate this Thierry?

:D
denthorq wrote:My friend is having an issue on his Ipaq 3700 series with the 'flighdemo' using PocketHAL. The game will not execute and just exit. He even soft reset his device. I'm assuming it is PocketHAL issue coz the file runs smoothly on my device 1910.
Can you investigate this Thierry?


As far as I know that demo isn't using PocketHAL 0.8. (Please post this in another thread) Or are you using an updated version?
I've been doing some tests with the PH0.8 palm version and it's really promising :) It runs faster than I expected (on a Tungsten E, at least) for a debug version. So far I have no complains about it (I mean, about pocketHAL, I could complain a lot about palm's documentation)

I just have one question (I hope not to make angry someone) but... here it goes.

is the palm tungsten E color extremely ugly?? it's just that I converted my functions to palm, and when I finished I thought I had some problems with endianess. looked at everything but found nothing. Afterwards I looked at the bitmap loaders. They seemed to be ok.
And finally took the minimal example and put a single pink in the screen. It's awful! (well, pink is usually awful, but I mean even more!)

So it seems everything it's ok, but it's just that the color is really ugly. I've seen some nice games, but they might be doing some color correction, or it's just that I can't spot the bug!


just as an acknowledgement, suposing that blue is 0x1f as an unsigned short int, the backbuffer is arranged so that it works ok in 68k, or so that it works ok in ARM mode?


well, no more ranting, back to work again ;)
Kak

-----
Edit:
well, it seems it's right for 68k, which means I'll (probably) have to (pre-)swap the low and high bytes.
Anyway works really well, everything seems to be working right now! :)
I found a weird behaviour, even with "minimal"

I compile the minimal sample. I execute it. It works well.

To debug it, put the "search mode" and type the special char (something like an l) dot , two. I execute it. It works well.

However instead of type l.2 , I want to use the DotDotTwo program that automatically types l.2 for you (and when you write as bad as me, it's a great program).

Whenever I tap the screen, the program (minimal, or my app) hungs and never returns.

I've also noticed that when the debugger should start, it looks freezed (both emulator and palm), and when I tap the palm screen I get the control back to both.

iirc I hadn't this issue with previous (non PHAL) palm projects, it could be a bug in l.2, of course, but it's been tested for years.

Maybe it's just a fault in l.2 , but I thought I should say this :)

The testing device is tungsten E (will try on T3 when I find the charger between this mess of cables...)
Kak wrote:is the palm tungsten E color extremely ugly?? it's just that I converted my functions to palm, and when I finished I thought I had some problems with endianess. looked at everything but found nothing. Afterwards I looked at the bitmap loaders. They seemed to be ok.


Do you know if the Tungsten E has a 16 bpp or 8 bpp (palette) display? Right now PocketHAL doesn't apply dithering on 8 bpp devices. Or do you mean the colors are just "washed out"? I have the same thing on my Tungsten T3. Sounds like the screens on Palm aren't as good quality wise.

Kak wrote:And finally took the minimal example and put a single pink in the screen. It's awful! (well, pink is usually awful, but I mean even more!)


Could you test with pure red, green and blue, just to make sure the screen is updated properly.

Kak wrote:just as an acknowledgement, suposing that blue is 0x1f as an unsigned short int, the backbuffer is arranged so that it works ok in 68k, or so that it works ok in ARM mode?


The backbuffer is in arranged so that 0x1F is pure blue. So you can use the same numeric constants on the backbuffer in 68K mode. 0xF800 is red, 0x07E0 is green and 0x001F is blue. Note that the bytes are swapped compared to a PocketPC. If you operate in ARM mode (say inside a PNO), you will need to swap the bytes.

well, it seems it's right for 68k, which means I'll (probably) have to (pre-)swap the low and high bytes.
Anyway works really well, everything seems to be working right now! :)


What do you mean it works now? Are the colors nice or still ugly?

Kak wrote:To debug it, put the "search mode" and type the special char (something like an l) dot , two. I execute it. It works well.

However instead of type l.2 , I want to use the DotDotTwo program that automatically types l.2 for you (and when you write as bad as me, it's a great program).


I have no idea what you are talking about. Can you explain in more details what this is about?
Thierry wrote:
Do you know if the Tungsten E has a 16 bpp or 8 bpp (palette) display? Right now PocketHAL doesn't apply dithering on 8 bpp devices. Or do you mean the colors are just "washed out"? I have the same thing on my Tungsten T3. Sounds like the screens on Palm aren't as good quality wise.


as far as I know it's 16bpp, however I found the cause, it was that I was working with the screen as if it was arranged for palm, while it's arranged for 68k (it's obvious that colors could only look ugly ;) )

Thierry":2zkpn28i]


Yes, I tested it, false alarm. I put some color bars and all the other colors look well, it's just that the magenta is extremely ugly ;) but as the yellow and cyan look well I wouldn't worry about it.



The backbuffer is in arranged so that 0x1F is pure blue. So you can use the same numeric constants on the backbuffer in 68K mode. 0xF800 is red, 0x07E0 is green and 0x001F is blue. Note that the bytes are swapped compared to a PocketPC. If you operate in ARM mode (say inside a PNO), you will need to swap the bytes.


ok, I see, that was the root of my headaches ;)
Is the palm screen memory arranged that way, or it's just to improve speed on 68k modes?


I have no idea what you are talking about. Can you explain in more details what this is about?


I'm not very skilled with words so I'll explain the whole process...

I use codewarrior to debug on the device, to do so, I just go to settings (alt+f7), debugger, palm os debugging.

switch the "device" instead of "emulator" and the communication mode.

Then, pressing f5 starts debugging on the device (and a message appears, place the device in console mode by entering Shortcut . 2.

Then go to the device (connected via usb/serial), tap the search and type shortcut (looks like an "l"), dot, two
The device enters console mode and you can debug with codewarrior.

i.e.
http://www.guidancesoftware.com/support ... s/pda.shtm
http://www.bcarter.com/tip090/tip090_16.htm


well, things go well this way, however there's a helping application (dotdottwo) in the codewarrior sdk

....\Metrowerks\CodeWarrior\(CodeWarrior Examp
les)\Palm OS\Metrowerks Examples\DotDotTwo

which does the same work as the sequence I've explained.

However, while the manual method gives no problems, executing DotDotTwo hangs the device as soon as you touch the screen (as I said I don't know if it's dotdottwo's problem or not)

I hope it's clear now ;)
Kak wrote:ok, I see, that was the root of my headaches ;)
Is the palm screen memory arranged that way, or it's just to improve speed on 68k modes?


Palm devices come in different flavors. Some have big-endian displays, other little-endian. Aren't you glad that PocketHAL deals with this for you =)

I decided on the current convention because this is what Palm uses for it's native Bitmap format. Also, hardware acceleration and/or optimizations are available on many devices when using thus native format. It does suck when writting ARM code though.



Also: I wasn't aware you could debug directly on the device. I will investigate this (eventually).
Palm devices come in different flavors. Some have big-endian displays, other little-endian. Aren't you glad that PocketHAL deals with this for you =)

yes :) however I can't understand how you did the entire thing without using the on device debugging (and if the documentation is so scattered as the one I'm suffering, it must have been a hell), is there any other way to debug code for ARM models? I thought the simulators were only emulating by recompiling the code as x86...


I decided on the current convention because this is what Palm uses for it's native Bitmap format. Also, hardware acceleration and/or optimizations are available on many devices when using thus native format. It does suck when writting ARM code though.


Makes sense, the faster the better :)
In fact the only place where I'll need to handle the swap will be in the image loaders. All the blits should be the same (except for alpha blits)


btw the debugger mentioned can be easily used when coding for 68k, when coding for ARM you need to do weird things with a debug nub, call some functions in your ARM code and you must have a serial cable
there's a nice explanation here:
http://www.palmos.com/dev/support/docs/ ... ugMgr.html
I'm glad PF8 doesnt need STLport anymore.

When will you add PNG support? :lol:

I'm watching PF progress hehe.
I expect to have the next PF release in January. It will have PNG support.
Thierry wrote:I expect to have the next PF release in January. It will have PNG support.


Cool! I assume with alpha blending like GD Alphablt()? Which I can blit the image without any separate img mask needed.
xmaster · 16 Dec 2004, 14:55 UTC — fsp on hx4700
argal wrote:1st of all, sorry for the response lag and for the poor english level : I was burned-out.

Well...
I've compiled/tested minimal on my toshiba e800, here is the result in "real VGA":
~35 FPS without using stylus, ~18 using it all around the screen
(on emulator, and hence without VGA, i got ~190 FPS)

I'm far.. far.. far away of your 130 FPS :/
Damned ! i think about changing my PDA now (and earn some money to ;))

Thierry, have you planned to use ATI imageon hardware on PHAL 8.x ? or do i have to begin to economize my poor geek money ? :cry:

I tried the same on my Ipaq hx4700 and the result is following:
about 59 FPS withoug using stylus and about 50 FPS with stylus moving around the screen.
Scarfman007 · 22 Dec 2004, 21:10 UTC
Hi,

Just wondering, whilst people are mentioning PF - will the next version by compatible with Symbian?

Cheers and Merry Christmas in advance!

Scarfman007
Hi,

I have been evaluating Alpha V3, and it works excellent in True VGA mode. But recently I've found some problem, first in my project, then in the "Minimal" sample.

If I compile a project without "HI_RES_AWARE" flag, so it creates 320-x240 screen even on VGA devices, the project causes a memory leak.
The project runs fine on a device for a minute, but then it starts to grab memory, 4K or more every second. After the project is closed, the memory is not being freed.

If I add the "HI_RES_AWARE" flag, the memory leak disappears.

The question is: do I do something wrong, or is it an alpha bug? And did someone else notice this problem?

The instruments involved:
Device: Pocket Loox 720.
Project: the "Minimal" sample.
Developing tool: EVC 4.0.
Memory tracking tool: Entrek ProcMan
Hi Lena, I have no VGA device, but please can you try to compile this project in eVC 3.0 for ARM PocketPC default platform (not 2002). If you have no evc 3.0 installed, you can PM me this project(even if it is the same minimal project) and I will compile it for your VGA device :wink:
:idea: Some 'possible' solution: try to recompile PocketFrog libs in eVC 4.0 (since, if I'm right, they are compiled in eVC3.0 and this 'could lead to some possible problems with eVC4.0 project')
Hi, BigBen! Thank you for your advice!

I had compiled the "Minimum" sample under VCE 3.0 and had had the same result. Then I decided to watch how the GAPI application behaves under the same conditions, and compiled the "GapiApp" sample. And again saw the memory leakage.

So I guess the problem has nothing to do with Phal. Maybe it's a conflict between a vga device and "vga unaware" application compiled under vce 4.0. Or anything else :)
Well, it's somehow amusing problem, but I'd recommend to try this on a "clean" device(to make sure it's not third party software's problem) and use your own memory query routines like this:

Code:

MEMORYSTATUS memstatus;
GlobalMemoryStatus(&memstatus;);
swprintf(TXT, L"%ld",memstatus.dwAvailPhys);
DrawText(60,5,TXT,1,Color(255,255,255),display);


If the problem still remain, I'll urgently add vgaawareness to my games.
I might look into implementing a PNG loader/blender before the next release. It wouldn't be too difficult, i've made quite a few image converters in the past and the alpha blending is very trivial. If I do get round to it i'll release it. Just so I know, would you prefer me to implement it as a patch for PF or a standalone plugin?

I'm a Professional Games Programmer so you shouldn't need to worry about code maintainability.

Just a side note: If I don't code it directly into PF, you'll have to use a custom "Surface" class for alpha to work properly. The engine i'm writing on top of PF at the moment also has a rendering pipeline which you might want to consider in the new version Therry. Great for Interfaces and Sprite ordering as well as optimising the rendering procedures.

I also think it would be very advisable to implement both a singleton controller class and exceptions. Just makes things easier.
I want to take some experience in coding on Palm platform. And have a question. Is it possible to use the PocketHAL library in armlet's? If yes, could you give me simple example of this.
moadib Thankful in advance.
Unfortunately PocketHAL 0.8 is lost forever. I lost the source code to it. There also isn't much demand for Palm support.