GLBasic forum

Main forum => GLBasic - en => Topic started by: AndyH on 2008-Jan-06

Title: Pocket PC / WinCE compile questions
Post by: AndyH on 2008-Jan-06
Hi - new owner of the Premium SDK so thought I'd try out the Pocket PC compilation.

I've SETSCREEN 240,320,0 which is my PocketPC's resolution (a Garmin iQue M4) and it compiled with quite a lot of compiler messages.  Doe these look OK:

Code (glbasic) Select
*** Configuration: WINCE ***
precompiling:
GPC - GLBasic Precompiler V.2007.348 - 3D, NET
Wordcount:46 commands

compile+link:
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (4384): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A7000, reserve_size 28672, allocsize 28672, page_const 4096
     11 [main] gcc 6096 sync_with_child: child 4384(0x138) died before initialization with status code 0x1
 119615 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (4324): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A7000, reserve_size 28672, allocsize 28672, page_const 4096
1378710 [main] gcc 6096 sync_with_child: child 4324(0x140) died before initialization with status code 0x1
1624715 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (4104): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A7000, reserve_size 28672, allocsize 28672, page_const 4096
3885862 [main] gcc 6096 sync_with_child: child 4104(0x154) died before initialization with status code 0x1
4133487 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (5212): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A7000, reserve_size 28672, allocsize 28672, page_const 4096
8498217 [main] gcc 6096 sync_with_child: child 5212(0x13C) died before initialization with status code 0x1
10830797 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (2400): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A7000, reserve_size 28672, allocsize 28672, page_const 4096
12102893 [main] gcc 6096 sync_with_child: child 2400(0x128) died before initialization with status code 0x1
12347905 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (440): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A8000, reserve_size 32768, allocsize 32768, page_const 4096
14882430 [main] gcc 6096 sync_with_child: child 440(0x160) died before initialization with status code 0x1
15061058 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (3204): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A8000, reserve_size 32768, allocsize 32768, page_const 4096
16326270 [main] gcc 6096 sync_with_child: child 3204(0x134) died before initialization with status code 0x1
16569464 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (532): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A8000, reserve_size 32768, allocsize 32768, page_const 4096
18833737 [main] gcc 6096 sync_with_child: child 532(0x130) died before initialization with status code 0x1
19076481 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (5044): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9A8000, reserve_size 32768, allocsize 32768, page_const 4096
23486645 [main] gcc 6096 sync_with_child: child 5044(0x154) died before initialization with status code 0x1
23583537 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (6076): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9AA000, reserve_size 40960, allocsize 40960, page_const 4096
24907286 [main] gcc 6096 sync_with_child: child 6076(0x154) died before initialization with status code 0x1
25090619 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (5072): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9AA000, reserve_size 40960, allocsize 40960, page_const 4096
26354332 [main] gcc 6096 sync_with_child: child 5072(0x168) died before initialization with status code 0x1
26597699 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
C:\Program Files\GLBasic\Compiler\platform\WinCE\Bin\gcc.exe (3432): *** couldn't allocate cygwin heap, Win32 error 0, base 0x9A0000, top 0x9AA000, reserve_size 40960, allocsize 40960, page_const 4096
28861211 [main] gcc 6096 sync_with_child: child 3432(0x160) died before initialization with status code 0x1
29105842 [main] gcc 6096 sync_with_child: *** child state waiting for longjmp
success
_______________________________________
*** Finished ***
Time: 35.2 sec
Build: 1 succeeded
I compiled as WinCE - I presume that WINCE_MediaQ is for a compaq device?



Anyway it runs on my pocket PC, but I notice a few oddities:


1. The screen is on its side.

On my PC my window is 240 x 320 so it is taller than it is wide.  I have some sprites moving across from left to right.

On the PocketPC the window is full screen (fine) but the text and sprites I am displaying start from the bottom left and go up to top right - its on its side.  X, Y = 0 is the bottom left of my screen, x=320, y=240 is the top right of my screen.  Shouldn't it be top left is X/Y = 0 and bottom right is x=240 and y=320 ?  Do you see what I mean.

I'm also testing for left and right cursor keys.  These work on the pocket PC but they are orientated with the screen, so up and down on the physical unit are acting as left and right to stay in-line with the orientation of the GLBasic's screen.

I guess it makes sense for it to be orientated that way as a games device but what if I want it to be portrait in orientation rather than landscape?  Is there an option I am missing for this?


2. Close box in top right but does not work

There is a close box at the top right of the physical unit.  I click this with the pen but nothing happens.... I can't end my program without reseting my PocketPC.   I am not issueing a hide or show of mouse pointer... do I need to?


3. Alpha PNG's not working

I have an alpha channel on a PNG, this is displaying as WHITE solid.  Is this a restriction on the Pocket PC version?  Should I use the transparent colour only and not alpha channels or should they be working?


4. Stalled after running for a few minutes

As I was typing this, after some time the app has stopped running.  The screen shows the app, but everything has stopped moving and responding (it seems).



Is there any information on things like this you can point me to?  I could find anything on the forums or the website.  I'm wanting to enter the GPX competition.  What sort of limitations can we expect on that device?  I haven't got one to test with.

BTW, I can get 120 sprites (64x64) on screen before it slows down.  That seems pretty good as my Pocket PC is not the fastest thing on the block.  Any idea what sort of performance we can expect from the GPX devices?
Title: Pocket PC / WinCE compile questions
Post by: Kitty Hello on 2008-Jan-07
1 - project options: Set to 240x320

2 - uh-oh. Make sure you do SHOWSCREEN or MOUSEWAIT

3 - Sorry, PocketPC supports no alpha in PNG. Try color 128,0,255 or SETTRANSPARENCY command. Sorry.

4 - uh- oh. I have to check that.

A PocketPC is a great device for testing, though the GP2X has much more power.
Take a look at my Wumbo's Adventure game. It runs at 60 fps on my GP2X. The PocketPC makes about 35-40 only.
Title: Pocket PC / WinCE compile questions
Post by: AndyH on 2008-Jan-07
Thanks Gernot,

#1 - excellent!

#2 - The code is below... any problems that you can see?

#3 - no worries, Will use the transparent color.

#4 - I've had it lock up twice out of five runs.  Sometimes it's gone on for ages with no problem.  The only thing I can add is that on the two occasions it did lock up, I was trying to get a response from it and was pressing the calendar, contacts and other buttons a few minutes before although I wasn't pressing anything when the lock ups occurred.

Code (glbasic) Select
GLOBAL width = 240

SETSCREEN width,320,0
LOADSPRITE "test.png", 0

LIMITFPS 60
GLOBAL x = 0
GLOBAL y = 200
GLOBAL tt = 100


WHILE KEY(0)=0

IF KEY(205) THEN INC tt, 20
IF KEY(203) THEN DEC tt, 20

PRINT "total: "+tt, 0,0

LOCAL t
FOR t=0 TO tt

GOSUB doNormal
//GOSUB doViewPort
//GOSUB doPolyVector

NEXT
VIEWPORT 0,0,0,0
  INC x, 1
  IF (x> width) THEN x = -32

SHOWSCREEN
WEND

SUB doPolyVector:
STARTPOLY 0
POLYVECTOR x,y, 0,0, RGB(255,255,255)
POLYVECTOR x,y+32, 0,32, RGB(255,255,255)
POLYVECTOR x+32,y+32, 32,32, RGB(255,255,255)
POLYVECTOR x+32,y, 32,0, RGB(255,255,255)
ENDPOLY
ENDSUB

SUB doNormal:
DRAWSPRITE 0, x,y
ENDSUB

SUB doViewPort:
VIEWPORT x,y,30,30
DRAWSPRITE 0, 0, 0
ENDSUB
Title: Pocket PC / WinCE compile questions
Post by: Kitty Hello on 2008-Jan-22
Oh dear. The memory error occours on Vista, right?
I have Vista, too and get the same. It's a shame. I have to find a solution for this.
Title: Pocket PC / WinCE compile questions
Post by: Kitty Hello on 2008-Jan-23
Got that bug tracked down. Next update fixes it.
Title: Pocket PC / WinCE compile questions
Post by: AndyH on 2008-Jan-23
Excellent news!
Title: Pocket PC / WinCE compile questions
Post by: Polarwolf on 2008-Jan-23
Quote from: GernotFrischOh dear. The memory error occours on Vista, right?
I have Vista, too and get the same. It's a shame. I have to find a solution for this.
Quote from: GernotFrischGot that bug tracked down. Next update fixes it.
You mean the Vista- Bug? Yeah... heared about it. I suggest uninstalling it! :D
Next Update fixes it? So you bought XP / got Linux and your installing / updating it now? ;)
Hunt Vista DOWN!
Title: Pocket PC / WinCE compile questions
Post by: Ian Price on 2008-Jan-23
Vista is not a bug.

It's a commercial virus :P
Title: Pocket PC / WinCE compile questions
Post by: AndyH on 2008-Jan-24
Hi Gernot

Did you find the bug in the PPC compiled EXE ?  

"4. Stalled after running for a few minutes"

I'm finding that running some code on the PocketPC is usually OK, but every now and then it will just lock up and requires a reset.  Doesn't seem like there is any one specific reason, hard to tell though.
Title: Pocket PC / WinCE compile questions
Post by: Kitty Hello on 2008-Jan-24
No clue, yet. Hard to tell...
Title: Pocket PC / WinCE compile questions
Post by: AndyH on 2008-Feb-05
As my code gets bigger, issue 4 is popping up more and more on Pocket PC.  I'm using arrays, drawsprites, zoomsprites and rotosprites.

Get runs for a period of time (sometimes a minute, sometimes longer) and it will just stop.  Only way out is a reset.  Memory leak?
Title: Pocket PC / WinCE compile questions
Post by: Kitty Hello on 2008-Feb-05
gulp.
Title: Pocket PC / WinCE compile questions
Post by: AndyH on 2008-Feb-05
I wish I could give you a piece of code and/or steps to follow to replicate it.  I do notice that if I do a reset and load no other programs and then run the GLB code it can run for a long time.  It's been mostly unstable when I have had other programs loaded and dormant in the background.

I have another PocketPC model I can get hold of to try it on, I'll see if it happens there too.

Incidentally, there's always a blue box with a cross in it at the physical top right of the display (bottom left when you rotate the PPC clockwise).  On simple apps, this can be clicked to close the app.  When I start drawing lots of sprites (I think it is this) this blue box is always there but it does not respond and no longer closes the app.
Title: Pocket PC / WinCE compile questions
Post by: AndyH on 2008-Feb-06
Hi Gernot - project ZIP file and more details posted here (http://www.glbasic.com/forum/viewtopic.php?pid=10246#p10246).

Tested on two Pocket PC's now, and both have the problem, although one slows down to a major crawl before locking up completely.  Details in that link.
Title: Pocket PC / WinCE compile questions
Post by: Kitty Hello on 2008-Feb-06
Does that also happen, when you do _not_ touch the screen?
Title: Pocket PC / WinCE compile questions
Post by: AndyH on 2008-Feb-06
Yes, have updated the bug report post.  I just leave it to run with no mouse clicks, although mouse clicks appear to not make a difference when I've done that.