PocketMatrix forums

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

PocketHAL 0.0.2 has been released.

The second release of PocketHAL, the next generation library for Pocket PC game development has been released.

Get it fresh at: http://pockethal.droneship.com

PocketHAL can currently be seen as an alternative to GAPI and GAPI-based libraries. You though GAPI was the fastest way to do graphics on your Pocket PC? Think again. PocketHAL can often run twice as fast as GAPI and further optimizations are in the work.

What's new in the 0.0.2 build:

* Fixed issue with iPAQ 3800 (screen would stay black)
* Mouse related messages now take the display orientation into account.
good news Thierry,
I'll try it right away

joost
Thierry,

Very strange : I compiled the sample code for PPC2003 with evc++ 4, cause I just upgraded to 2003 on my iPaq 3850, but it still seems to have the same problem, nothing on the screen.
I will go back to PPC2002 on my iPaq and check if the PPC2002 lib is working ok using evc++ 3. I let you know

regards, Joost
It seems I messed up again =(

Please download PocketHAL_0_0_2b.zip and give it a try.
Thierry,
Good news ; it's working ok now on the iPaq3850, I've tested it on WM2003. Thanks!
A bit off topic, but maybe you have experience with it: I seem to have trouble loading images in wm2003 using your slightly adapted 'image.cpp' file, I guess the imgdecmp.lib is no longer working on the wm2003 OS. Any idea?

Joost
ignore my previous remark about the non working imgdecmp, it does work on wm2003
Yeah, I was going to say so =)
Works on an iPaq 3870. VSync seems to work.

Nice :)
Works great on my MIPS E-125.

I used JoostB's Simple and PocketHal 0.0.2 to hack together an old demo I did on EasyCE many moons ago. Supposed to be like one of those Plasma globes. Touch the screen and the filaments are attracted to the touch.

Here it is if anybody wants to check it out, only tested on the E-125 and a Toshiba E310:

EDIT:
WARNING! Do not use with iPAQ3600 and 3700 family devices.

ARM: http://jammiesoft.arwen.com/simple_arm.exe

MIPS: http://jammiesoft.arwen.com/simple_mips.exe

Screenshots:
Image
Image
Image

Button A cycles through a few different palettes
Button B exits
Left & Right adjusts how random each filament is
Up & Down adjusts how long to delay before blending and fading.

Pam
Looks good Pam!
Unfortunately i´m without any pda here... I sold the cassiopeia and bought a 1910 that is not here yet ( I know the 1940 is newer, but I would not tolerate the yellow screen issue )
Hmmm. Maybe I'm doing something wrong, I took the ARM exe and copied it over on my iPAQ 3630 and tried to run it.. white screen. Do I need to copy some stuff over from PocketHAL also ?

-Sam
and damn.. Could not turn off the iPAQ after the test. Reset didnt work either. Had to do a factory reset ! (didnt have anything important on it anyway).

Take this as a warning.. I mean, warn people.

Sam
Yes there is an issue with iPAQ3600 and 3700 being investigated right now. This is being discussed in another thread: http://www.pocketmatrix.com/forums/view ... hp?t=13189
Does anybody else use the emulator? When I use the 2002 emulator, the Start Menu bar at the top does not go away, and while the D-Pad buttons seem to work fine, I can't seem to get the button events for the application buttons.

Anybody else have problems or just me doing something wrong? :D

Pam
Pam wrote:
Does anybody else use the emulator? When I use the 2002 emulator, the Start Menu bar at the top does not go away,


Make sure you create a fullscreen window (240x320), that it is the topmost and that you hide the taskbar properly. I have never tried any of the emulators myself...


Pam wrote:
and while the D-Pad buttons seem to work fine, I can't seem to get the button events for the application buttons.


Again, I have never used any emulator, but I see no reason why the key codes would not be posted to your window... PocketHAL has no control over this.
pam wrote:
Here it is if anybody wants to check it out, only tested on the E-125 and a Toshiba E310:

Very nice, works great on the iPaq3850, I like this effect very much.
I wonder how you generate the path of one beam ...
using fractals maybe?
Thierry wrote:
Make sure you create a fullscreen window (240x320), that it is the topmost and that you hide the taskbar properly.


Ok, thanks. Found this one.

I'm using JoostB's simple mini Frog. Joost, in game.cpp, FROG_PPC isn't defined:
Code:

void Game::ShowTaskbar( bool bShow )
{
#if defined(FROG_PPC)

if (bShow)
::SHFullScreen( m_hWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON | SHFS_SHOWSTARTICON );
else
::SHFullScreen( m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON );

#elif defined(FROG_HPC)

// Nothing to do...

#endif
}


Not sure why this seems to work anyway on a real PocketPC, but it didn't work on the emulator. Commenting out the #if...#elif...#endif seems to work fine.

Thierry wrote:
Again, I have never used any emulator, but I see no reason why the key codes would not be posted to your window... PocketHAL has no control over this.


I'm getting the event properly, but the key codes don't seem to be valid. Here's what I'm doing:
Code:

void Simple::ButtonUp( int button )
{
KeyList *keys = new KeyList();
::GetKeyList(keys,ORIENTATION_NORTH);

if(button == keys->vkA)
{

}
}


This works fine on my E-125, but on the emulator, keys->vkA, keys->vkB, etc. are always zero. It seems they are not defined.

Pam
JoostB wrote:
I wonder how you generate the path of one beam ...
using fractals maybe?


I wouldn't call it fractals really, but I guess its the same idea. Simple recursion, dividing the line in half and choosing a new random mid point, then repeating on the two new segments.

Code:

void Simple::test(int sx, int sy, int ex, int ey, int level)
{
int tmpx,tmpy;

if(level > 0)
{
tmpx = ((sx+ex)/2) + (randint(level*4)-(level*2));
tmpy = ((sy+ey)/2) + (randint(level*4)-(level*2));

test(sx,sy,tmpx,tmpy,level-1);
test(tmpx,tmpy,ex,ey,level-1);
}
else
{
myline(IFP(sx),IFP(sy),IFP(ex),IFP(ey),65,GetDisplay()->GetBackBuffer()->GetPitch()>>1,buff2);
}
}


Pam
That is fractal subdivision. I recently posted code that does that in two dimensions, in the General Developer Discussion, using the diamond-square algorithm.

http://www.pocketmatrix.com/forums/view ... hp?t=13314
I see what you mean. I haven't read about fractals in years, I just assumed there was more to it than that.

When I think of fractals I think of mandelbrot, which is more complex, or the patterns that repeat infinitely.

But now that I think about it, and read your other post, I've seen landscapes created that way.

Pam
Yeah there are more complex fractals, but also simple ones like the Koch triangles, which are also recursive subdivision. Randomize the subdivision (instead of just a triangle), and you have a random fractal like you did.
pam wrote:
Joost, in game.cpp, FROG_PPC isn't defined:


Pam, you're right, it's a bug. I guess it was working since pockethal is writing directly to the video ram, and not really considering those settings. However, when the clock in the taskbar was being updated to the next minute, sometimes I could see the taskbar flashing between two gameloop frames. I guess this explains it. The system was not aware of the fact that the taskbar was hidden and forced a refresh of the taskbar. removing the #ifdef should solve this. Thanks!

mlepage wrote:
That is fractal subdivision. I recently posted code that does that in two dimensions, in the General Developer Discussion, using the diamond-square algorithm.

Quite an interesting topic, could we generate a terrain heightmap with that? maybe in combination with multiple textures that blend over with respect to the height. I read something at flipcode concerning that.
It would also be funny to use Pam's lightning algorithm to light up a spooky fractal terrain = a PocketHal(loween) demo.
Yes you can make terrain!

The key to the fractal subdivision is, it is random globally but not locally. That is, points that are near each other have similar height, but points that are far from each other can have totally different heights.

A simple way to make terrain, is to take the height map and fill in the bottom bit with water, leaving land in the middle, and mountains up high.
The issue with the iPAQ 3600 was found and fixed.

Version 0.0.3 will hopefully be released tonight with the fix and major speed improvement in non-native orientation.