PocketMatrix forums

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

Some possible bugs

--In the new build I am getting a error with G_UNIT followed by an error stating grid is out of bounds and to use SetGridSize to fix it.

--Sometimes when I try to "Replease All" I get an error that states there is something wrong with the DELETE

--I am getting no errors for out of bound arrays when I create a sprite array. I DIM(Sprite$, 3); but I can create Sprite$[5] on up without any errors.

--More of a question. Can you not use any of the SetSpriteBlahBlah code with Sprite structs?

--It doesn't seem to matter if a sprite's elasticity is set to .001 or 100, it seems to have the same effect.

--Other sprites bounce off of sprites that have elastisity properties. Is that normal, and can you change this so that a sprite will not bounce off an elastic sprite?
1. The G_INIT function has been updated and the GameAPI.ppl as well. Check the demos for more on this. You need to supply the resolution in the parameters now.

2. Which function are you using? ReplaceAll?

3. PPL will not run in rangecheck mode unless specified. If you are running from the PIDE, you should be getting an exception dialog. I will double-check this one tomorrow.

4. It's not recommended but yes you don't have to use the SetSprite...() functions. You will however need to use the ProcessSprite() function to process any internal processing when you are done making changes to the sprite's struct.

5. Send me a demo, I will fix it if need be.

6. Sprite that have no elasticity shouldn't bounce off sprite with it. Can you please include this piece of code in the demo you will send me, I will fix it as well.
Hi Kornalius and others

Long time since I have contributed.

I have downloaded that latest release and attempted to compile run my existing program(s).

I find that the following routine which has worked in the past no longer works. It would appear that it always returns a null string. If I create a temporary string within the function and assign the value of the list variable to it, then return that string then it appears to work.

Code:

func GetCSV(aString$,index$)
local(lst$);

List(lst$);
StrTolist(aString$,",",lst$);
index$--; tmp$="";
if ((index$ >= 0) & (index$ < count(lst$)))
goto (lst$,index$);
return (str(lst$));
else
return("");
end;
end;



comments?
Smok Wawelski · 25 May 2005, 10:22 UTC
Two more bugs:

1/ when trying to pull-down menu File in PIDE I've got Access violation in module PIDE.exe. The workaround: I have to use New window first.

2/ Winsock demo does not work for me:
Welcome to the PPL Console

Opening internet connection...
Connecting to ppl.arwen.com:80...
Opening request for /index.htm document...
Sending request for /index.htm document...
Reading /index.htm document...

Document content



Closing request handle...
Closing connection handle...
Closing internet handle...


sw
Hi Smok,

I also note that attempting to create a "Socket" (for UDP transmission) works once. Subsequent attempts fail. The problem can only be resolved by resetting my PDA. This may be connected with your reported "winsock" issues (or it may be un-related). The code has worked in the past.

Based on previous experience I attempt to resolve one problem at a time.

In the PIDE there is also a "strange effect". After editing a PPL file I attempt ATL-F/V (File/Save all). A message box appears to say the file I have just edited has not been saved. I accept and the file is saved, but then it is removed from the edit area. Same effect if I "click" on the "File" menu. This is totally different behaviour to previous releases. While it is an "inconvenience" it certainly can be worked around.

cheers
Found another problem ....

"Benchmark" fails at:

Struct Copy Loop Test ....

program just hangs at that point.

cheers
The PIDE bugs have been fixed. They were introduced in the last build when I tried to create custom popup menus for the text edit control and the project list control.

Merve: I have fixed the return() statement bug. Don't know why it's been changed but it's back to normal now.
Just finished fixing the structure copy internal code, it is also much faster now.
Smok Wawelski · 25 May 2005, 14:36 UTC
Winsock demo doesn't work under PC - it returns no document. But, the worse - on PPC - it hangs up. I had to use task manager to kill it.
kornalius wrote:1. The G_INIT function has been updated and the GameAPI.ppl as well. Check the demos for more on this. You need to supply the resolution in the parameters now.

2. Which function are you using? ReplaceAll?

3. PPL will not run in rangecheck mode unless specified. If you are running from the PIDE, you should be getting an exception dialog. I will double-check this one tomorrow.

4. It's not recommended but yes you don't have to use the SetSprite...() functions. You will however need to use the ProcessSprite() function to process any internal processing when you are done making changes to the sprite's struct.

5. Send me a demo, I will fix it if need be.

6. Sprite that have no elasticity shouldn't bounce off sprite with it. Can you please include this piece of code in the demo you will send me, I will fix it as well.


1. Thanks
2. I am using the built in Replace All in the Find/Replace menu of the editor.
3. How do you specify for a range check?
4. I think I wrote this question wrong. What I was trying to say was: I CAN'T seem to use any SetSpriteBlahBlah's with a struct sprite. I get errors. I would like to be able to.
6. I shoot a bullet that has no elasticity, and it bounces off a target WITH elasticity.
2. bmanske is working on the editor, it is a work-in-progress.

3. You can tell PPL to run in range check mode by using the following command line:

ppl.exe myprog.ppl|R

The command line separator is |

You can also use the editor or the PIDE and use the regular run feature, it will put PPL in range check mode.

6. I will fix it.
Thanks!

any more info on Number 4?
Give me some code example, I still don't understand your question! :)
Struct(M$, tsprite);

Setspriteelasticity(M$ ...)

this, or any other SetSprite won't work for me. gives me an error.
Use Int(&M;$) this will pass the handle of M$ as an integer value.
Hi all,

kornalius wrote:2. bmanske is working on the editor, it is a work-in-progress.


It's a good thing that Kornalius said something, or I wouldn't have realized that this is an item for me.

I think that when NPOS was changed to match the documentation in ther CHM file, this bit of code didn't get fixed. I will check into it and hopefully slip it into the next release.

bmanske
Thanks Kornalius

I will keep testing

cheers
It was just a problem left over from when NPOS changed. I have fixed it.

While I was in there, I fixed a few more things like the index calculation for skipping over the search string, the changed$ flag wasn't getting set when doing a replace and I rewrote the WholeWord option.

bmanske
even the PPL samples give me the G_UNIT errors (even though the resolution is set. Along with the "setgridsize needs to be fixed" error.

Also, InitGameAPIEX is not documented and so I can't figure out what is wrong. I have tried using G_INIT but only get more errors.

Also, I can't turn off the device, and turn it back on or the game will crash.
mmtbb: Make sure you have the latest GameAPI.ppl file in your lib folder. You could also have an older copy of this file in your project's folder. PPL will use this file first.

As for the InitGameAPIEx() I will add it on Monday before the next release comes out.
Kornalius

I have found a "strange" bug. Refer to my code block below

Code:

func getLat(aString$)
local (strLa$,ds1$,ds2$,ds3$);
strLa$ = str(GetCSV(aString$,4));
if (length(strLa$) >= 7)
ds1$ = int(mid(strLa$,0,2));
ds2$ = int(mid(strLa$,2,2));
ds3$ = int(mid(strLa$,5,length(strLa$)-5));
la$ = int(ds1$) + ((int(ds2$)+((1.0*int(ds3$))/10000.0))/60.0);
if (GetCSV(aString$,5) == "S")
print(concat("negating la$: ",la$));
la$ = -la$;
print(concat("negated la$: ",la$));
end;
print(concat("returning ",la$));
return(la$);
else
lat$ = 0.0;
end;
end;


The "print" statements are for debugging and testing.

This function NEVER returns a negative value, even when the debug trace indicates that it tried. That is to say that "negating" and "negated" lines print, but the value of la$ is always the same .. it does not change.

If I replace the principle expression with:

la$ = -1.0*la$;

EVERYTHING THEN WORKS OK.

I am really having trouble believing what I am seeing. It would appear that the UNARY MINUS operator is failing!

I can confirm this with this simple piece of test code

Code:

test$ = 29.1234;
print(concat("negating test$: ",test$));
test$ = -test$;
print(concat("negated test$: ",test$));

You never get a negative printout value.


H E L P !!!!!


cheers
I checked and I have the latest GameAPI.ppl file, and there are no other GameAPI files anywhere else. kind of strange
mervjoyce · 30 May 2005, 06:53 UTC — Possible Memory Leak
Kornalius,

I think there are still some "memory leaks" issues in PPL.

My "mapping" program leaks about 1.75Mb/hr. It doesn't cause any immediate disaster, but it is worth resolving if possible. I am attempting to localise the offending code examples for you.

My main program is a

While (1)
//program code goes here
end;

type loop. Originally you had some issues with freeing memory within such loops but I feel that you reolved them at the time.

At first glance the problem appears to involve (at least) use of DIM variables.

I'll update this matter as soon as I have some reliable data.

BTW: I spent the last couple of days converting much of my "mapping" program to use "Objects". The inability to have a "List of Structures" and assign the list pointer for external use was quite limiting. However using Objects gets around all of that. "List of Objects" works fine (can now use all my code from Delphi).

It takes a little practice to remember to assign pointers (eg: &st;$ = cm$) rather than copy the object and cause memory leaks (cf: st$ = cm$), but I now have it right. Great job!

cheers
Merve:

1. I have fixed the - operator problem. The optimizer was the problem.

2. As for the memory leak, please send me a sample code so that I can fix it.
mmtbb: The InitGameApiEx() is not an internal PPL function but a function defined in the GameAPI.ppl library.

Here is how to use it:

Code:
InitGameAPIEx(h$, &gameproc;, 240, 320, true, 15, 60);

(true) defines wheter it's fullscreen or not.
(15) is the processing speed.
(60) is the maximum of FPS allowed.

Here is the function definition in GameAPI.ppl:

Code:
proc InitGameAPIEx(hWnd$, Proc$, Width$, Height$, FullScreen$, Speed$, FpsSpeed$)
_init(hWnd$, Proc$, width$, height$, ORIENTATION_NORTH, Speed$, FpsSpeed$, fullscreen$);
end;
Hi Kornalius,

Thanks for all that.

I will try to get you something "tangible" on the memory leak as soon as possible, however it may have to wait until after this next release. I have a client who wants a job done by Friday - it takes all the fun out of this business (but it pays the bills)

cheers
Smok Wawelski · 03 Jun 2005, 13:04 UTC — Another strange behaviour
I've been playing with StarField2.ppl example. I made a program which draws lines as a pen. When compiled on PC - it runs OK. But on PPC - it draws those lines about 10 pixels lower than I press the stylus. It looks like readings of Y position is shifted down.
Any ideas?

(I'm using exactly the code from Starfield2 to read stylus position).

The strange is that on PC when I move mouse cursor off the screen those readings are HUGE numbers (ie 234234243 or so). Maybe PPL is trying to set them to negative numbers?


Code:

func mainproc(hWnd$, Msg$, wParam$, lParam$)
ok$ = true;

case (Msg$)

WM_CLOSE:
// Shutdown Game API.
ShutGameAPI(hWnd$);

WM_LBUTTONDOWN:
// Get the angle between two points.
a$ = Angle(border.left$ + (border.right$ - border.left$) / 2, border.top$ + (border.bottom$ - border.top$) / 2, wParam$, lParam$);
Sprites(s$, NULL);

(I mean wParam$ and lParam$)
I have the same problem here. It was introduced when I updated to the newest version of PocketHAL.

Try changing the fullscreen parameter in the GameApiInit(). I will have to find a solution for this problem.
webba · 24 Nov 2005, 10:10 UTC — Incorrect Y parameter value
Hi all,

Long time since my last post - just trying to get going again!

Has anything else been done about the 'Y' parameter problem? I've tried changing the fullscreen param as suggested - no effect.

Hope you are all OK!

(I've attached a modified version of one of the simple demos)
Attachments:
test2.ppl (1 KB)
Hi Webba,

Welcome back!

The code you provided is running perfect on the PC and the PPC with the latest build I have. I hope to release 0.8 official next week. I you want an interim build to test, please send me an email to (kornalius_at_videotron.ca, please _at_ by @) I will send it to you.
Thanks kornalius,

As per my email - I have tested with latest build and all is now working!

Cheers!
You are welcome. :)
Tutareal2. Line:
b$ = NewControl(500, "BUTTON", NULL, "Greetings", 0, form$, 70, 100, 100, 20);

Should be
b$ = NewControl(500, "BUTTON", NULL, "Greetings", WS_VISIBLE, form$, 70, 100, 100, 20);