Ariane Soft PPL2 Pocket Programming DataMite
  #1  
Old 10-06-2009, 05:18 PM
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Default PPL too fast?

I have come across a situation where my code is too fast when run.

I have similar code in blitz basic that runs smooth as silk. In PPL, the screen updates happen sooo fast that you cant see what is going on.

I know I have asked Alain before about a WAIT VERTICAL BLANK command or something similar that will sync the program with the refresh of the monitor, but how? can I slow my program down to make it update at the correct speed?

I have changed the last 2 variables in the INITGameAPIEX function, but this makes it judder and jump!

Thanks

Mike.
Reply With Quote
  #2  
Old 10-07-2009, 01:10 AM
kornalius kornalius is offline
Administrator
 
Join Date: Apr 2006
Posts: 551
Default Re: PPL too fast?

I thought I gave you an answer already on this. I believe I added it to the pocketfrog library internally. I will have to check that again. I will add it to my todo list just in case.
__________________
Regards,
Alain Deschenes
ArianeSoft Inc.
http://www.arianesoft.ca
Reply With Quote
  #3  
Old 10-07-2009, 01:12 AM
kornalius kornalius is offline
Administrator
 
Join Date: Apr 2006
Posts: 551
Default Re: PPL too fast?

Btw the ppl engine core as been rewritten and should be even faster. It's nice to hear that ppl is too fast though.
__________________
Regards,
Alain Deschenes
ArianeSoft Inc.
http://www.arianesoft.ca
Reply With Quote
  #4  
Old 10-07-2009, 07:22 AM
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Default

You are right, you have included it in 1.60 and 2.11

For some reason I did not get the eMail update for that thread (http://forums.arianesoft.ca/showthre...1909#post11909)

Will give it a go and see what sort of results I get!

Mike.
Reply With Quote
  #5  
Old 10-07-2009, 01:30 PM
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Angry Too much speed - Now I'm not so sure!

OK, so I have determined that it is not a speed issue as such;

What I think is happening is the Math in PPL is different to the Math in Blitz Basic.

Here is my code;

for (cnt$, 0, 720)
qcos$[cnt$] = cos(cnt$);
qsin$[cnt$] = sin(cnt$);
end;

Here is the blitz basic code;

For count = 0 To 720
qcos#(count) = Cos(count)
qsin#(count) = Sin(count)
Next

Technically there is no difference; Have a look at the attached image and you will see that the numbers generated in COS and SIN are completely different. Now my math is rubbish, but I know that COS and SIN tables are standard (Otherwise they would be no use to anyone), so how come I get different values?

PPL help states that COS "returns the cosine of parameter X as a double" where as blitz basic help states that COS "returns a number between -1 and 1. This value represents the "X" coordinate of point x,y"

It seems failry obvious that PPL handles COS and SIN differently, but what the difference is I cant seem to find out.

Can anyone shed any light on this for me? - Am I being stupid and completely missing something here?

Cheers - Mike.
Attached Thumbnails
Click image for larger version

Name:	PPL&BlitzOutput.jpg
Views:	203
Size:	95.0 KB
ID:	302  
Reply With Quote
  #6  
Old 10-07-2009, 01:57 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

are you completely missing cos360 and sin360? they return the standard values between -1 and 1
Reply With Quote
  #7  
Old 10-07-2009, 02:04 PM
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Default

Holy Moly!

You da man! - thats great - works a treat!

Now why did I not think about those!

See its true. A fresh pair of eyes on the problem .. works every time.

Thanks NickNack - you are my saviour!

M.
Reply With Quote
  #8  
Old 10-07-2009, 05:09 PM
kornalius kornalius is offline
Administrator
 
Join Date: Apr 2006
Posts: 551
Default

Oh great, thanks NickNack, I did not have an answer for that one!
__________________
Regards,
Alain Deschenes
ArianeSoft Inc.
http://www.arianesoft.ca
Reply With Quote
  #9  
Old 10-07-2009, 06:33 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

I had the same problem a long time ago, but...you don't forget those where you really had to rack your brain over it that easily
Reply With Quote
  #10  
Old 10-09-2009, 08:26 PM
Donone Donone is offline
Senior Member
 
Join Date: Jan 2007
Posts: 713
Default

I notice Mike that on 10-7 you comment...
Quote:
You are right, you have included it in 1.60 and 2.11
Do you refer to the expected version 1.60 (to follow 1.53) and if so, has it been issued yet?

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.
Copyright © 2009 www.ppl-lang.com - All rights reserved
Web Design by BR Web Consulting Ltd