Omnimaga

Calculator Community => Discontinued => Major Community Projects => Correlation => Topic started by: Hot_Dog on November 11, 2010, 12:54:18 am

Title: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 11, 2010, 12:54:18 am
In designing the Ti-Basic Text routines, I'm going to use hooks so that Ti-Basic programmers won't have too much to learn.  I'm going to use Output() to display 6x8 characters (for compatability and familiarity) and Text() for custom size text, where the default is 3x5. 

However, not having a huge knowledge of Ti-Basic, I need some suggestions as to what tokens to use for the following:

1. A command that will update the screen after all text has been drawn
2. A command to change the program that the font is located in
3. A command to allow people to switch back to the normal TI-OS routines, and also back to the custom font routines
4. A command that allows a user to specify the custom size of his font

Thanks for anything you can offer
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 11, 2010, 12:58:44 am
Hmm, you know Output( is on homescreen, right? Also you can display large fonts with Text(-1,Y,X instead of Text(X,Y. It's an undocumented trick.

I would suggest DispGraph to update the screen, maybe, since it's already used for displaying the graph screen content in BASIC anyway.
Title: Re: I don't know what tokens to use and need suggestions
Post by: meishe91 on November 11, 2010, 01:04:28 am
I don't know a whole lot about hooks and assembly libraries and such but if it actually changes the use of the token then I would maybe suggest DispTable instead of DispGraph since that can still be used in a game while I've never seen DispTable used.
Title: Re: I don't know what tokens to use and need suggestions
Post by: AngelFish on November 11, 2010, 01:24:46 am
1. A command that will update the screen after all text has been drawn
2. A command to change the program that the font is located in
3. A command to allow people to switch back to the normal TI-OS routines, and also back to the custom font routines
4. A command that allows a user to specify the custom size of his font

1. DispGraph or DispTable
2. Get( or OpenLib(
3. Stop, PlotsOff, rref(
4. setTmFmt(, fnInt(, Graphstyle, Real(

For the last one, a custom token might be your best bet.
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 11, 2010, 01:39:12 am
I would avoid OpenLib( and setTmFmt(, because they are not available on the 83+ and 83+SE.
Title: Re: I don't know what tokens to use and need suggestions
Post by: AngelFish on November 11, 2010, 02:01:15 am
Oh, I didn't know that. Openlib really is a useless command, though.
Title: Re: I don't know what tokens to use and need suggestions
Post by: TIfanx1999 on November 11, 2010, 02:22:54 am
In designing the Ti-Basic Text routines, I'm going to use hooks so that Ti-Basic programmers won't have too much to learn.  I'm going to use Output() to display 6x8 characters (for compatability and familiarity) and Text() for custom size text, where the default is 3x5.  

However, not having a huge knowledge of Ti-Basic, I need some suggestions as to what tokens to use for the following:

1. A command that will update the screen after all text has been drawn
2. A command to change the program that the font is located in
3. A command to allow people to switch back to the normal TI-OS routines, and also back to the custom font routines
4. A command that allows a user to specify the custom size of his font

Thanks for anything you can offer
My thoughts:

1. DispGraph
2. Select( or Prompt
3. ExprOn/ExprOff
4. Get or Prompt maybe?
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 11, 2010, 02:48:30 am
Oh, I didn't know that. Openlib really is a useless command, though.
Yeah I think it only has uses for some apps. I think USB8x is one of them.
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 11, 2010, 11:44:08 am
The verdict:

1. DispTable
2. Select(
3. ExprOn/Off
4. Real(

Thanks to everyone for their input!
Title: Re: I don't know what tokens to use and need suggestions
Post by: Deep Toaster on November 11, 2010, 12:25:47 pm
Oh, I didn't know that. Openlib really is a useless command, though.

What does it do? I don't have an 84+, but just wondering.

The verdict:

1. DispTable
2. Select(
3. ExprOn/Off
4. Real(

Thanks to everyone for their input!

Those sound pretty reasonable. And as a request, could the new hook be enabled by a prgm header? Some of those might actually be useful in plain BASIC programs.

Can't wait to see how this turns out :D
Title: Re: I don't know what tokens to use and need suggestions
Post by: JosJuice on November 11, 2010, 12:44:13 pm
Oh, I didn't know that. Openlib really is a useless command, though.

What does it do? I don't have an 84+, but just wondering.
It opens a lib. This is useless because there is only one lib in the whole world as far as I know (USB8x) and that lib not exactly something you would use in a normal TI-BASIC program :P
Title: Re: I don't know what tokens to use and need suggestions
Post by: Deep Toaster on November 11, 2010, 01:01:49 pm
Wait, so TI actually added that feature for third-party apps? :o
Title: Re: I don't know what tokens to use and need suggestions
Post by: JosJuice on November 11, 2010, 01:10:23 pm
I think so. I've never seen a TI lib.
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 11, 2010, 01:29:19 pm
Those sound pretty reasonable. And as a request, could the new hook be enabled by a prgm header? Some of those might actually be useful in plain BASIC programs.

You use asm(pgrmTEXT) at the beginning of your BASIC program to turn the hook on, and you use asm(pgrmTEXT) at the end of your program to turn it off.
Title: Re: I don't know what tokens to use and need suggestions
Post by: Deep Toaster on November 11, 2010, 01:47:41 pm
Oh, that's great! Don't forget about real( conflicting with xLIB.
Title: Re: I don't know what tokens to use and need suggestions
Post by: FinaleTI on November 11, 2010, 03:25:04 pm
Oh, that's great! Don't forget about real( conflicting with xLIB.
And det( and identity( conflicting with Celtic III and sum( conflicting with DCS7.
Title: Re: I don't know what tokens to use and need suggestions
Post by: Deep Toaster on November 11, 2010, 03:48:27 pm
Will he use them for this, though?
Title: Re: I don't know what tokens to use and need suggestions
Post by: AngelFish on November 11, 2010, 04:31:02 pm
Oh, I didn't know that. Openlib really is a useless command, though.

What does it do? I don't have an 84+, but just wondering.

As was said, it opens a library. I don't think TI did it for 3rd party development though. I seem to remember hearing about how there were certain restrictions placed on the type of libraries it would call that made it useless for pretty much everyone except TI.
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 11, 2010, 04:43:26 pm
Oh, that's great! Don't forget about real( conflicting with xLIB.

Actually, you won't be able to use both at the same time.  It's the way the OS is built.  But I'll use Label On and Label Off to allow a user to switch between xLIB and the font routines.
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 11, 2010, 09:02:39 pm
Will Label On/off be useable in BASIC so we can swap between them in our games when needed? That would be cool!
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 11, 2010, 09:49:14 pm
Will Label On/off be useable in BASIC so we can swap between them in our games when needed? That would be cool!

Yes, they will be useable in BASIC!  However, you would have to use Label On every time you wanted to switch from Xlib/CelticIII/etc. to Correlation (as it's now called) and Label Off every time you wanted to switch from Correlation to Xlib etc.
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 11, 2010, 09:50:53 pm
Ah that would be fine I think.

Btw you rename tokens, right? I hope you don't create new ones, because Omnicalc 1.0/1.1 did that and we couldn't send files to another calc or the computer.
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 11, 2010, 09:56:13 pm
Btw you rename tokens, right? I hope you don't create new ones, because Omnicalc 1.0/1.1 did that and we couldn't send files to another calc or the computer.

Tokens remain just the way they are, I don't change names or anything.  That way, for people who want to switch between Correlation and Ti-OS routines in their programs, they won't have to be confused with names.
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 11, 2010, 10:31:27 pm
But where is Label Off located, then? ??? I never saw that on my 83+ ???
Title: Re: I don't know what tokens to use and need suggestions
Post by: MRide on November 11, 2010, 10:32:31 pm
It's with AxesOn/Off, GridOn,Off and all those.
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 11, 2010, 11:21:05 pm
Just go to 2nd -> Format
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 11, 2010, 11:59:23 pm
Oh right, I remember now ^^. Thanks.
Title: Re: I don't know what tokens to use and need suggestions
Post by: ztrumpet on November 11, 2010, 11:59:56 pm
Keep in mind that Select(), ExprOn/Off, and LabelOn/Off are all two byte tokens. :)
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 12, 2010, 12:00:48 am
Keep in mind that Select(), ExprOn/Off, and LabelOn/Off are all two byte tokens. :)

Ah, yes.  Thanks for letting me know :D
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 12, 2010, 12:48:20 am
Now I know what you meant by Correlation earlier. I didn't notice the project name change. ;D
Title: Re: I don't know what tokens to use and need suggestions
Post by: TIfanx1999 on November 12, 2010, 11:23:17 am
I'm glad things are decided. This is gonna be sweet! ^^
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 23, 2010, 08:07:39 pm
I'm using real(  for selecting fonts now. 

For those of you interested, Select(), like Output(), is a class 2 function.  It is difficult for a custom parser to work with class 2 functions.
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 24, 2010, 02:34:00 am
What does class 2 means?
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 24, 2010, 03:42:05 am
What does class 2 means?

Class 2 is a lot of Ti-Basic programming functions, such as If, While, End and Goto.  Output( is a class 2 function because you can't use it outside of a Ti-Basic program.  (A goof-up by the Ti-OS)

For more information:

http://wikiti.brandonw.net/index.php?title=83Plus:Hooks:9BAC
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 24, 2010, 03:44:49 am
Ah I see, thanks for the info. :)
Title: Re: I don't know what tokens to use and need suggestions
Post by: Deep Toaster on November 24, 2010, 10:36:13 am
What does class 2 means?

Class 2 is a lot of Ti-Basic programming functions, such as If, While, End and Goto.  Output( is a class 2 function because you can't use it outside of a Ti-Basic program.  (A goof-up by the Ti-OS)

Oh, so it was just a mistake? I've always thought it was annoying how it couldn't be used from the homescreen.
Title: Re: I don't know what tokens to use and need suggestions
Post by: Hot_Dog on November 24, 2010, 06:00:23 pm
What does class 2 means?

Class 2 is a lot of Ti-Basic programming functions, such as If, While, End and Goto.  Output( is a class 2 function because you can't use it outside of a Ti-Basic program.  (A goof-up by the Ti-OS)

Oh, so it was just a mistake? I've always thought it was annoying how it couldn't be used from the homescreen.

It was done on purpose.  By goof-up, I mean that TI once again stinks at OS development
Title: Re: I don't know what tokens to use and need suggestions
Post by: DJ Omnimaga on November 24, 2010, 10:38:37 pm
I guess they thought it would be best to disallow basic control/output commands from being used on the home screen. If I remember, some casio calcs allowed you to use those commands on the home screen, but I might be wrong. It might be more commands but not all.