This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
IntrnalDsK


Member


Joined: 23 Jun 2003
Posts: 103

Posted: 14 Aug 2003 12:10:35 am    Post subject:

I am working on a greyscale routine for TI-BASIC, and i was wondering if I could get some tips on speed, like is Pxl-On() faster than PxlChange()?

I heard that using : like "While 1:End" slowed it down. Is this true?



I will be using the technique that I thought of a while ago. It does stuff like this:
Black:
Pt-On(A,B)
Pt-On(A,B)
Pt-On(A,B)
Pt-On(A,B)
Dark Grey:
Pt-On(A,B)
Pt-On(A,B)
Pt-On(A,B)
Pt-Off(A,B)
Grey:
Pt-On(A,B)
Pt-On(A,B)
Pt-Off(A,B)
Pt-Off(A,B)
Light Grey:
Pt-On(A,B)
Pt-Off(A,B)
Pt-Off(A,B)
Pt-Off(A,B)
White:
Pt-Off(A,B)
Pt-Off(A,B)
Pt-Off(A,B)
Pt-Off(A,B)
But black and white will be optimized for size and speed. I will try to post the source to a greyscale demo that I made soon.

edit by arcane wizard: I turned of smileys for you since they replace all the B) 's


Last edited by Guest on 14 Aug 2003 06:09:11 am; edited 1 time in total
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 14 Aug 2003 06:13:11 am    Post subject:

Well, you could test the speeds yourself:

For(X,1,500
Pxl-On(1,1
End

Check how long it takes to run that, then check how long the following runs:

For(X,1,500
Pxl-Change(1,1
End

You can use a similar method to check if while 1:End slows it down.

I was planning on writing a document with such timings for all the basic commands a while ago but I didn't have any accurate enough means to clock with and it looked like too much work and nobody would use it.

I'd check it all for you but my batteries are dead. Sad


Last edited by Guest on 14 Aug 2003 06:14:04 am; edited 1 time in total
Back to top
Tyler


Advanced Member


Joined: 29 May 2003
Posts: 352

Posted: 14 Aug 2003 07:46:23 am    Post subject:

But even if you got it to work, what would you do with it because you can't make the screen 'flash grey' or anything...
Back to top
IntrnalDsK


Member


Joined: 23 Jun 2003
Posts: 103

Posted: 14 Aug 2003 10:16:01 am    Post subject:

but those commands up there give the illusion of grey pixels. They are somewhat flickery, but it will do.

I also have no efficent way of clocking it, besides a broken watch Sad I'll try, though...
Back to top
Tyler


Advanced Member


Joined: 29 May 2003
Posts: 352

Posted: 14 Aug 2003 10:52:03 am    Post subject:

Double click on the time on your start bar (you don't have a Mac right?) and watch the seconds go up, it shouldn't be that far off
Back to top
IntrnalDsK


Member


Joined: 23 Jun 2003
Posts: 103

Posted: 14 Aug 2003 03:02:53 pm    Post subject:

The thing is, they go so fast anyway that there isn't too much of a difference.
Back to top
KD5YTX


Advanced Member


Joined: 03 Aug 2003
Posts: 306

Posted: 14 Aug 2003 07:34:26 pm    Post subject:

Greyscale in BASIC? Make an ASM addon that accepts inputs via calc vars for a rectangular formation to shade grey, and a number between 1-5 or 1-10 stating the darkness of the shape.
Back to top
IntrnalDsK


Member


Joined: 23 Jun 2003
Posts: 103

Posted: 14 Aug 2003 08:59:26 pm    Post subject:

I was also thinking about that. It does seem interesting, but the completely BASIC one was looking cool, untill it horribly collapsed under the weight of the slow TI-BASIC interpretor of my calc. Mad Oh well.. so much for that.

Note: For() commands are the slowest things that I have ever seen in my life. Expecially nested.


Last edited by Guest on 14 Aug 2003 08:59:47 pm; edited 1 time in total
Back to top
JesusFreak
JesusFreak


Active Member


Joined: 17 Jun 2003
Posts: 537

Posted: 14 Aug 2003 10:15:12 pm    Post subject:

what if you wanted to do a whole screen? it would be slow, no?
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 15 Aug 2003 02:08:43 am    Post subject:

Yes, it would be increadibly slow, espessially since there is no box drawing function in basic so you have to use lines or draw individual pixels.

Last edited by Guest on 15 Aug 2003 02:08:50 am; edited 1 time in total
Back to top
Ben Trettel


Member


Joined: 17 Jul 2003
Posts: 153

Posted: 15 Aug 2003 06:33:47 am    Post subject:

Or you could invert text and draw some spaces. That should be faster, especially with big text.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 15 Aug 2003 06:43:39 am    Post subject:

Which requires assembly, so you might as well just draw the screen black with assembly instead... or draw the screen black, save it as a pic and recall it when needed.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement