Omnimaga

Calculator Community => Discontinued => Major Community Projects => Correlation => Topic started by: Hot_Dog on November 10, 2010, 12:59:43 am

Title: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 12:59:43 am
Hello, Fellow Lobsters,

Ztrumpet's Exodus, Builderboy's Serenity, DJ Omnimaga's RPG games and Tifreak's Pokemon Purple are examples of games that show how awesome Ti-Basic games can be.  

Most Ti-Basic games are text-based, of course, and there's nothing wrong with that.  However, the TI-OS text-based routines are slow, let's not deny that.  Furthermore, it can be frustrating having to work with fonts that do not contain any of the characters you want.  Wouldn't it be nice if you could have a text-based game that runs quickly and displays shapes, sprites, etc. that you want?

After the success with my S.A.D. Font Routine (Special thanks to Iambian, Calc84maniac and Calcdude84se), I plan on releasing some ASM programs for Ti-Basic programmers to use.  The Ti-Basic programmer will create an 8x8 font or a small text font and store it to a program, say Font.8xp, which can be archived.  Then the user can use big text routines and small text routines using ASM programs I have provided, routnes which will be similar to Ti-Basic routines save needing Ans.  For the heavy-duty ti-basic programmers, this will allow custom text graphics with high speed.

If you want pure-basic programs, these ASM programs are not for you.  However, they can really speed up your text-based program if needed, and provide sweet looking backgrounds and even sprites!

Please comment!  Also, is there another font size that I should include?  I will pick the most popular ones.
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: AngelFish on November 10, 2010, 01:04:34 am
Will the full range of TI-OS fonts be available?
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on November 10, 2010, 01:11:27 am
I definitely like the idea. Question, will this utility allow the use of the full screen? And by standard sizes, I assume you mean 3X5, 5X7, and 8X8? I know they are a little larger and generally not used as "font sizes", but I think 12X12 and 16X16 would interest people as well.
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 01:13:31 am
Will the full range of TI-OS fonts be available?

Do you mean like all the characters you can use for small font and such?  One can use up to 256 characters.  Most of them can be typed using the keypad, but some require tokens.  However, if you're talking about using the normal Ti-83+ font, I don't know if I can make that possible.  However, you would be able to display those by continuing to use the normal Text(), Display(), etc. OS routines

Quote
will this utility allow the use of the full screen? And by standard sizes, I assume you mean 3X5, 5X7, and 8X8? I know they are a little larger and generally not used as "font sizes", but I think 12X12 and 16X16 would interest people as well.

I'll keep those in mind when I tally up the numbers.  Yes, full screen will be allowed :D
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on November 10, 2010, 01:16:04 am
Full screen=win ;D
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 01:19:21 am
Oh, and as usual, full documentation will be provided, including instructions for creating your font
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 10, 2010, 01:22:38 am
That would be great. One thing, though:

Remember that the Asm() command is very slow when the VAT is filled with many files, especially sub-routines. As a result, if a BASIC game uses about 80 sub-programs, Each executions of Asm(prgmNAME) will take about 0.5 second before responding at all. Because of that, this would need to be a hook. Maybe some sort of Doors CS 7 plugin? I wonder if it's possible to install a parser hook from an Asm() program, though. It might be best if someone wants to keep ASM lib usage to minimum and just use yours.

An example of how slow Asm() is is ROL3 map loading. Each tile takes 0.33 seconds.

That said, I'm curious about future development on this. :)
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 01:25:33 am
That would be great. One thing, though:

Remember that the Asm() command is very slow when the VAT is filled with many files, especially sub-routines. As a result, if a BASIC game uses about 80 sub-programs, Each executions of Asm(prgmNAME) will take about 0.5 second before responding at all. Because of that, this would need to be a hook. Maybe some sort of Doors CS 7 plugin? I wonder if it's possible to install a parser hook from an Asm() program, though. It might be best if someone wants to keep ASM lib usage to minimum and just use yours.

An example of how slow Asm() is is ROL3 map loading. Each tile takes 0.33 seconds.

Gotcha.  I'll definitely need help with hooks
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: meishe91 on November 10, 2010, 01:30:30 am
@AoC
The two fonts are actually 4*6 and 6*8 ;) (You forgot about the buffer areas that are occasionally used, in the small text anyways.)

This seems cool though. I'm not entirely sure if I entirely understand it but still seems cool :D
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 10, 2010, 02:55:23 am
In summary, it's an ASM lib for BASIC programmers that lets you use custom fonts with a custom font routine as alternative to TI's text commands. I think Celtic III/DCS used a custom font routine that could draw text to the buffer instead of directly to the screen, so you could display everything at once instead of gradually, but I don't think it let you use different font sets.
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 01:37:32 pm
I forgot to mention that your font doesn't have to take a lot of disk space.  If you need only 10 special characters for the whole game (using the Ti-OS routines for regular text), your font file will be very small.  If you want a lot of text-based sprites, you will need a bigger font file.  There will also be error messages if you make a mistake!
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 10, 2010, 01:48:13 pm
So we don't need all chars? It would be nice because Omnicalc fonts included every font and were extremly large. Sometimes, all we need is 0 through 9, A through Z, a through z, dot, comma, exclamation mark, question mark, arrow and I even saw some NES RPGs where i and j, i and l and that stuff were merged together to save space.
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Xeda112358 on November 10, 2010, 01:50:00 pm
Hey, not to spam or anything, but I have made a program (SpriteLib) which lets you edit the font a little and use the display routines I even included an example (try example 2) to show what it can do. It is an ASM program and it sets the font hook to work during BASIC program execution and for the hex digits. Example 1 has more maps, but was created early on without the full use of all of the functions...

http://www.ticalc.org/pub/83plus/asm/graphics/spritelib.zip
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 01:50:54 pm
So we don't need all chars? It would be nice because Omnicalc fonts included every font and were extremly large. Sometimes, all we need is 0 through 9, A through Z, a through z, dot, comma, exclamation mark, question mark, arrow and I even saw some NES RPGs where i and j, i and l and that stuff were merged together to save space.

That's right!  You don't need all chars.  But that reminds me, I need to let the user pick which char he needs to start at.  Sadly, if you need all numbers except the number 7, you would still need a character for 7 in your font.  The text routines let you pick your starting and ending characters, but they don't let you skip characters.
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 10, 2010, 01:53:26 pm
AH ok I see, so we can't skip letters, but we can skip some other chars like Theta, %, $, etc? That said, I would myself keep a few spare unused chars included so I can use them for icons like sword, armor, item, etc. :D
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 05:47:06 pm
Hey, not to spam or anything, but I have made a program (SpriteLib) which lets you edit the font a little and use the display routines I even included an example (try example 2) to show what it can do. It is an ASM program and it sets the font hook to work during BASIC program execution and for the hex digits. Example 1 has more maps, but was created early on without the full use of all of the functions...

http://www.ticalc.org/pub/83plus/asm/graphics/spritelib.zip

Nah, it's not spamming.  Quite a nifty program, if I say so myself!  So don't take the next line as an insult, because it's quite impressive.  However, just like your program can do things mine can't, I'm adding features that SpriteLib doesn't have.
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: MRide on November 10, 2010, 05:52:01 pm
So, it's like Omnicalc fonts, but with more versatility, and the user doesn't have to do anything?
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 05:53:44 pm
So, it's like Omnicalc fonts, but with more versatility, and the user doesn't have to do anything?

Well, the user does have to run something to enable/disable hooks in his basic program, and create his own font of course.  Other than that, it is more versatile, faster, and can be done with regular Output(), Text(), etc. commands.
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Raylin on November 10, 2010, 05:56:32 pm
It would be nice if one could install an APP on the calc that could make a brand new locale-based font and change the locale in the program temporarily so that the other font is displayed.

(i.e. the foreign language programs preinstalled on the calcs.)
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on November 10, 2010, 06:00:45 pm
I didn't realize it was going to work with Text and Output. That's pretty nifty! =) So the hooks "point" to your custom routine to display text when the program is enabled as opposed to TI's?
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 06:04:06 pm
So the hooks "point" to your custom routine to display text when the program is enabled as opposed to TI's?

Exactly.  I just need to understand how to get it to work.  No trouble yet ;)
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: ztrumpet on November 10, 2010, 06:14:47 pm
Sounds neat.  I don't know how much I'd use it, but it's a neat alternative. :)
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 10, 2010, 06:38:34 pm
Now that I understand hooks, I'm going to use Output() to let people specify a font character size.  Text() will display the text.  I'm also going to have something that will update the screen when all text is drawn.

So, a person will run pgrmText to enable the special font routines.  If there is a need in the Ti-Basic program to use the regular Ti-Basic font (with normal Output and Text functions), another hooked function is run to switch back and forth.  At the end of the program, pgrmText is run again.
Title: Re: New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 11, 2010, 01:28:24 am
What if someone wants to use the homescreen at one point, though? ???

Maybe ANOVA? (although that's a 2 byte token, if I remember)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 13, 2010, 02:49:55 am
Correlation will now come with two programs.  The first will be pgrmCORELATE.  This program will be small--hopefully 200 bytes or less--and is used for initalizing and deinitalizing.  The other program is pgrmFONTROUT.  It's much bigger, but it can be stored in archive.

Both programs are required for Ti-Basic programs wanting to do custom fonts using Correlation.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 13, 2010, 03:05:28 am
Ah ok so it installs font files and hooks?

Also could you answer the first question in http://ourl.ca/7842/139516 ?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 13, 2010, 03:12:11 am
Ah ok so it installs font files and hooks?

Also could you answer the first question in http://ourl.ca/7842/139516 ?

pgrmCORELATE installs hooks, but does not need to install fonts.  The user specifies a font in his program by using Select().

Sorry about not answering that first question.  If I read it correctly, Output() will display a homescreen-sized font, but it will not appear on the homescreen when the program ends.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 13, 2010, 03:13:37 am
It does in BASIC. Try it for yourself on a real calc.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 13, 2010, 03:15:33 am
It does in BASIC. Try it for yourself on a real calc.

It does in Basic because it uses the Ti-OS font routines, which save to a Text Buffer.  With correlation, I'm using special routines that do not save to a text buffer, or else gibberish would appear when a Ti-Basic program ends. 
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 13, 2010, 03:16:18 am
Oh ok but what if someone absolutely needs to use the homescreen while using Coorelation?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 13, 2010, 03:18:10 am
Oh ok but what if someone absolutely needs to use the homescreen while using Coorelation?

To use the homescreen, the person would have to use the Ti-OS font--it's the nature of the beast.  You can turn Correlation off in the middle of your Ti-Basic program to use the Ti-OS font.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 13, 2010, 03:19:44 am
Oh right, I see now.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Xeda112358 on November 13, 2010, 03:20:35 am
Yeah, your program is looking very cool. This will be very useful, I can see that. So is this going to use a parse hook and font hook?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 13, 2010, 03:22:16 am
Yeah, your program is looking very cool. This will be very useful, I can see that. So is this going to use a parse hook and font hook?

Only the parse hook.  Font hooks are too slow because they are used by the slow Ti-OS routines.  Instead, fonts will be compiled as programs, such as pgrmMYFONT.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 13, 2010, 03:22:45 am
/me wonders if this will be useable in Axe
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Xeda112358 on November 13, 2010, 03:24:36 am
Oh, well there is a neat twist!. So you are going to be making the routine for how Output( and the like act? That is really nice and that will make the routine fast as well.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 13, 2010, 04:13:29 am
/me wonders if this will be useable in Axe

Not unless we can incorporate it.  Sorry :(--but then since you can display sprites/tilemaps in axe, you really don't need it

Oh, well there is a neat twist!. So you are going to be making the routine for how Output( and the like act? That is really nice and that will make the routine fast as well.

Yes.  Output will display a custom standard 6x8 font, and Text() will display a custom sized font, the default being the size of small text.  The limitation is all characters must be the same size.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 13, 2010, 01:29:28 pm
Ah ok I see. Still it's an awesome project, though. It will really be useful for BASIC coders because using custom fonts in BASIC with xLIB/Celtic/DCS is slow.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on November 14, 2010, 10:20:06 am
You mentioned this on the first page, but I wanted to be sure. Each font set can contain a total of 256 characters? Is there a reason for the limit? I will admit though, it seems very unlikely that anyone would need more that 256 characters.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Deep Toaster on November 14, 2010, 11:24:16 am
/me wonders if this will be useable in Axe

Not unless we can incorporate it.  Sorry :(--but then since you can display sprites/tilemaps in axe, you really don't need it

Oh, well there is a neat twist!. So you are going to be making the routine for how Output( and the like act? That is really nice and that will make the routine fast as well.

Yes.  Output will display a custom standard 6x8 font, and Text() will display a custom sized font, the default being the size of small text.  The limitation is all characters must be the same size.

So just for clarification, both Output( and Text( draw to the graphscreen, right?

Sounds great! Good luck on this.

You mentioned this on the first page, but I wanted to be sure. Each font set can contain a total of 256 characters? Is there a reason for the limit? I will admit though, it seems very unlikely that anyone would need more that 256 characters.

Well, the TI-OS font has 256 chars, and it seems reasonable...
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: thepenguin77 on November 14, 2010, 11:29:49 am
Since I know that you can have the font set archived, I just have one tip from experience. Store the location of the font set in the archive in ram, don't re-find it every time. Sure, it seems instant, but instant * 16 isn't so fast any more. Anyways, this looks like a really cool project. :D
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 14, 2010, 11:51:05 am
Since I know that you can have the font set archived, I just have one tip from experience. Store the location of the font set in the archive in ram, don't re-find it every time.

No sooner said than done!

But if a font is located in RAM, would deleting and adding variables change its location?

Quote
Each font set can contain a total of 256 characters? Is there a reason for the limit? I will admit though, it seems very unlikely that anyone would need more that 256 characters.

It's a reasonable standard.  But the reasons I'm doing it is there aren't very many tokens available on the Ti-83+.  Sure, there's more than 256, but here's what I have to keep in mind, for example:

1. For people who want to save space in their Ti-Basic program, they'll use tokens instead of lowercase letters in their strings to display.
2. For people who want easy-to-remember characters by using standard ASCII (and don't care about program size), they'll use lowercase letters instead of tokens pertaining to ASCII 97 to 122.

In both instances, the same font characters will be displayed.  But that means I need both sets of tokens available.  So there aren't much more than 256 total possiblitities for a character from a font.  However, with the option to have several fonts available for the same program, that won't make much of a difference.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: thepenguin77 on November 14, 2010, 12:56:05 pm
But if a font is located in RAM, would deleting and adding variables change its location?

That's true. What I would do is put in a safety check. Make the first two bytes of the file $6969 or $1337 or something. So if that's not what your pointer shows, then re-find it. That would even work for the archive in case the BASIC program happens to pull a garbage collect. (I guess technically it can happen)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 14, 2010, 01:06:40 pm
As long as the font sets won't take space for 256 chars even when they contain 40 or so, I am fine.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 14, 2010, 03:42:49 pm
But if a font is located in RAM, would deleting and adding variables change its location?

That's true. What I would do is put in a safety check. Make the first two bytes of the file $6969 or $1337 or something. So if that's not what your pointer shows, then re-find it. That would even work for the archive in case the BASIC program happens to pull a garbage collect. (I guess technically it can happen)

Thanks!  That's a good idea.

As long as the font sets won't take space for 256 chars even when they contain 40 or so, I am fine.

Your font will be only as big as you want it to be.  The calculator will tell you if you try to go beyond the range of the number of characters you have.  For example, if your font contains only characters for "A" "B" and "C", the calculator will not let you use "S" and "0".
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 15, 2010, 12:35:12 am
Ah ok sounds good :)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 15, 2010, 01:54:59 am
Output can now display any size font.  The difference is Output() displays in 8 rows, 16 columns, unlike the Text() 96 columns x 64 rows.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 15, 2010, 03:07:54 am
Ah ok, so Output will align them on some sort of grid of 6x8 no matter what?

Also, for Text(), will clipping be supported?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on November 15, 2010, 08:58:46 am
I'm unsure if this is the same thing DJ is asking, but in BASIC when you use Output, if the string is over 16 charcters the text will wrap around to the next line. Will text and output function this way in Correlation so that wordwrap effectively functions as a tilemap?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 15, 2010, 11:20:20 am
Now that you mention this, that would be cool actually. i wonder how hard it would be?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on November 15, 2010, 11:34:10 am
Yea, it would be really sweet. It's something I'd definitely like to see! ^^
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 15, 2010, 12:10:52 pm
"Wrap around" will be supported with Output, and clipping will be supported with Text.

Btw, the maximum font size will be 16 x 16.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 15, 2010, 12:24:53 pm
Ah ok, sounds good. :)

Also, those fonts are really real fonts corresponding to respective TI-OS chars, right? I am asking this because it would be cool to be able to display custom fonts based on a string of characters, for example, like the character name, chosen at the game start.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 15, 2010, 12:32:32 pm
Ah ok, sounds good. :)

Also, those fonts are really real fonts corresponding to respective TI-OS chars, right? I am asking this because it would be cool to be able to display custom fonts based on a string of characters, for example, like the character name, chosen at the game start.

Yes they are, if you create your font correctly.  Following the instructions in the manual, for example, you can make your own "L", your own "I", your own "N" and your own "K" to display the string "LINK" in customized graphics.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Builderboy on November 15, 2010, 02:06:46 pm
And you will be able to modify all 256 characters in the Ti OS font set?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 15, 2010, 02:47:01 pm
And you will be able to modify all 256 characters in the Ti OS font set?

Sorry, no.  You can only use your own font with up to 256 characrers.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Builderboy on November 15, 2010, 02:54:40 pm
o.O wut?  I am suddenly confused. when you install the hook, it modifies the Output and Text commands so that Strings are displayed using a separate font routine right?  And so if you try to display the letter L, it will look for the custom font L, and use that instead?

My question was if it supported replacement of all 256 characters, although it would seem so XD
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 15, 2010, 03:07:00 pm
o.O wut?  I am suddenly confused. when you install the hook, it modifies the Output and Text commands so that Strings are displayed using a separate font routine right?  And so if you try to display the letter L, it will look for the custom font L, and use that instead?

My question was if it supported replacement of all 256 characters, although it would seem so XD

What I meant is, when your program is all finished, the calculator will use return to the normal TI-OS font.  You won't see any custom characters.  You can have your own font, but you can't muck around with TI's font.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: ztrumpet on November 15, 2010, 03:48:12 pm
This is looking neat.  I may have to try something with this... ;D
* ZTrumpet has idea...  O.o
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 15, 2010, 11:55:45 pm
Ah ok, sounds good. :)

Also, those fonts are really real fonts corresponding to respective TI-OS chars, right? I am asking this because it would be cool to be able to display custom fonts based on a string of characters, for example, like the character name, chosen at the game start.

Yes they are, if you create your font correctly.  Following the instructions in the manual, for example, you can make your own "L", your own "I", your own "N" and your own "K" to display the string "LINK" in customized graphics.
Cool to hear! :D
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on November 16, 2010, 08:28:50 am
"Wrap around" will be supported with Output, and clipping will be supported with Text.

Btw, the maximum font size will be 16 x 16.
That is incredibly awesome! ^^ I'm really looking forward to playing with this! =)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Deep Toaster on November 16, 2010, 11:16:31 am
Quote from: Hot_Dog
"Wrap around" will be supported with Output, and clipping will be supported with Text.

Btw, the maximum font size will be 16 x 16.

Great! Tilemaps are going to be so easy with this...

A question: Can we have different sizes for different chars?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: JustCause on November 16, 2010, 11:28:11 am
Wow. This is cool.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 16, 2010, 02:06:42 pm
Quote from: Hot_Dog
"Wrap around" will be supported with Output, and clipping will be supported with Text.

Btw, the maximum font size will be 16 x 16.

Great! Tilemaps are going to be so easy with this...

A question: Can we have different sizes for different chars?

Not really.  In a 6x8 font, you can have an uppercase A bigger than a lower a, but they must both be 6x8.  If you want different sizes altogether, you will need to create more than one font.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 16, 2010, 02:50:20 pm
Question: What kind of drawing methods will be supported? Will they be the same as xLIB? (overwrite, OR, XOR, AND, LCD update0?

Also will a 6x8 letter be the same size as a 8x8 one? (Since 1 byte is a multiple of 8 pixels)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 16, 2010, 03:02:16 pm
Question: What kind of drawing methods will be supported? Will they be the same as xLIB? (overwrite, OR, XOR, AND, LCD update0?

Also will a 6x8 letter be the same size as a 8x8 one? (Since 1 byte is a multiple of 8 pixels)

Just like Text() and Output(), text drawing will be strictly overwrite.  Also, 6x8 fonts will be drawn as 6x8, just like on the homescreen.  However, they will be the same size in bytes as 8x8, if that's what you mean.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 16, 2010, 04:34:55 pm
Ah ok, thanks for the info. I wondered about drawing methods since a lot of people like to have white text on black backgrounds.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 16, 2010, 04:43:08 pm
Ah ok, thanks for the info. I wondered about drawing methods since a lot of people like to have white text on black backgrounds.

That won't be hard.  I can do that
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: ASHBAD_ALVIN on November 16, 2010, 04:54:46 pm
This looks really cool!  Can't wait until a release!
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 16, 2010, 08:18:45 pm
Ah ok, thanks for the info. I wondered about drawing methods since a lot of people like to have white text on black backgrounds.

That won't be hard.  I can do that
Cool to hear! :D
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 18, 2010, 09:01:57 pm
Btw would it be very hard to add XOR/OR logic too? With XOR we could use grayscale text/sprites maybe (Reuben Quest style) and/or blinking text animations. AND might be useful too, for masking, but I think the person can easily combine OR'ed and XOR'ed fonts together to do it.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: FinaleTI on November 18, 2010, 09:03:00 pm
Btw would it be very hard to add XOR/OR logic too? With XOR we could use grayscale text/sprites maybe (Reuben Quest style) and/or blinking text animations. AND might be useful too, for masking, but I think the person can easily combine OR'ed and XOR'ed fonts together to do it.
XOR would be nice for greyscale, but overwrite can work for that too.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 18, 2010, 11:24:16 pm
Yeah true, although it isn't as convenient for all purposes. It's better for title screens with nothing moving on the tiles.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 18, 2010, 11:30:48 pm
Btw would it be very hard to add XOR/OR logic too? With XOR we could use grayscale text/sprites maybe (Reuben Quest style) and/or blinking text animations. AND might be useful too, for masking, but I think the person can easily combine OR'ed and XOR'ed fonts together to do it.

I guess that wouldn't be too hard now that ln( is being incorporated.  ln( with 3 arguments would be OVERWRITE, and a 4th argument would be XOR, OR and AND.  Don't get your hopes up, though, we'd have to see how it goes
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 18, 2010, 11:34:05 pm
er, shouldnt they use the same argument? In xLIB, OR/XOR/AND/Overwrite all use the same argument.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 18, 2010, 11:38:18 pm
er, shouldnt they use the same argument? In xLIB, OR/XOR/AND/Overwrite all use the same argument.

Yes that's correct, but it doesn't have to be that way.  The person who did xlib just chose to do it that way.  I'm working with compatability for previous Ti-Basic programs
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 18, 2010, 11:43:30 pm
Ah ok. What would be the advantage of separating them? I am curious about what special tricks we could do. Also is it easier to keep them separated?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 19, 2010, 06:08:52 am
Ah ok. What would be the advantage of separating them? I am curious about what special tricks we could do. Also is it easier to keep them separated?

To answer your question, if they are kept seperated, a person can take a Ti-Basic program, and he can easily convert it to Correlation simply by replacing Output( with ln( and Text( with e^(.  He does not need to scroll to the end of each line to add a parameter.  (This really frustrated me in Ti-Basic programming)  Furthermore, it saves two bytes per line, and I figured most of the time people are going to use overwrite except for sprites.
 
It's just as easy to keep the argument count seperate as it is to incorporate them all together.  It's just like Ti-Basic Line(, where a zero is added only draw a white line.

As a side note, if XOR/OR/AND is successful, I'll add Mask as well.  A character to be drawn as a Masked character will require 2 characters worth of data in the font, but it will be faster than using XOR/OR/AND to manually draw the mask.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 19, 2010, 09:42:06 am
Ah ok so you wanted default method to not require arguments? What about the other? Will it default to OR? I still don't get why you keep them separate. ???
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 19, 2010, 09:49:48 am
Ah ok so you wanted default method to not require arguments? What about the other? Will it default to OR? I still don't get why you keep them separate. ???

ln(1,1,"AAAA") will display "homescreen" text AAAA using Overwrite.  e^(1,1,"AAAA") will display small text using Overwrite.

ln(1,1,"AAAA", 1-4) will display "homescreen" text using OR, AND, XOR, Mask.  e^(1,1,"AAAA", 1-4) will display small text using OR, AND, XOR, Mask.

I'm afraid I can't explain any better why I keep them seperate.  Just remember, Line(1,1,2,2) displays a black line, but if you add an extra argument--Line(1,1,2,2,0)--you get a white line.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: adamac16 on November 19, 2010, 02:13:55 pm
I would like to know more about this. I seen the first post and im interested.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on November 19, 2010, 06:06:30 pm
Ah ok so basically it's just that if no argument is specified, it uses Overwrite? I was confused since with Line if you add a 5th argument that is a 1 it's the alternate way to display a black line (probably for those who don't use a constant for it and want to create a flashing effect)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 19, 2010, 06:25:02 pm
Ah ok so basically it's just that if no argument is specified, it uses Overwrite? I was confused since with Line if you add a 5th argument that is a 1 it's the alternate way to display a black line (probably for those who don't use a constant for it and want to create a flashing effect)

That's right.  No argument specified means it's overwrite.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Deep Toaster on November 19, 2010, 07:08:03 pm
Will the homescreen text be confined to the 16x8 grid, or will the location be like with Text(?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on November 19, 2010, 08:55:15 pm
Will the homescreen text be confined to the 16x8 grid, or will the location be like with Text(?

Same as with Ti-Basic.  ln() will use 16x8 grid, and e^() will use the 96 x 64 grid
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 09, 2010, 01:21:00 pm
After two weeks of head throbbing from having to do only what the OS let me do, I'm getting close to a screenshot release.  I just have some bugs to fix in the ln( routine, but the parser is working so far.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 09, 2010, 06:27:16 pm
Cool! And sorry to hear the (annoying) TI-OS gives you so much troubles. I hope it isn't gonna be too bad on 2.53 MP...
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 10, 2010, 02:04:53 pm
Here's a new screenshot: A first look at Output using ln(

Note that the run indicator won't be there in the future, but I had to pause the program to test it.

The program is only 10% done, but this is definitely the end of the step 2.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: yunhua98 on December 10, 2010, 02:09:53 pm
Wow!  thats looks great!  are there any known bugs?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 10, 2010, 04:33:32 pm
Wow!  thats looks great!  are there any known bugs?

There are so many bugs that if they were all fixed, the program would be 20% done.  Basically, I can't list them all. 

However, I will say that there's a "Syntax Error" from the parser after the ln( statement is done executing.  Something I can fix, but need to do.  Also, the routine doesn't yet clip sprites, and ln( doesn't correctly display in a 16 x 8 grid yet.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on December 10, 2010, 09:30:46 pm
I'm glad this is coming along. I hope bug squashing goes well. =)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: meishe91 on December 10, 2010, 10:27:40 pm
I'm glad to hear about some progress :) I was actually about to ask about how this was coming. Good luck on getting things working correctly and all.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 11, 2010, 12:13:57 am
I'm glad to hear about some progress :) I was actually about to ask about how this was coming. Good luck on getting things working correctly and all.

My goal--just a goal mind you--is to have this ready to test by January.  The major headache portion is over and done.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 11, 2010, 12:46:23 am
Looks nice! Good luck fixing all bugs!
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Deep Toaster on December 11, 2010, 12:48:56 pm
That looks really nice :o So we could display the entire tilemap with just ln(! Good luck with the bugs!
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 12, 2010, 05:51:57 pm
I'm done with the "meat" of the program!  Three cheers!

Now that I'm working on the side dishes and the seasonings, there won't be any more screenshots, but I will definitely give progress updates.  To start with, the program now does everything Output( can do, even Output(A+100, B^5, sub(Str1 + Str2))

My next step is AND, XOR, OR and Mask
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: TIfanx1999 on December 13, 2010, 09:36:39 am
Very nice! =)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 13, 2010, 12:53:21 pm
Couple of notes:

1. Taking into account how many people use tilemaps, if you use ln( and e^( , you can specify a negative value for the X Coordinate.  However, you cannot go lower than -99.  Also, if you go so far to the left that you go past the end of a string, you'll recieve an error.

2. It is now a requirement that pgrmFONTROUT (needed for Correlation) reside in Archive.  You'll recieve an error if the program is in RAM.  The reason for doing this is to keep anything but a garbage collect from moving the program to a different location during the execution of your Ti-Basic program.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 14, 2010, 02:34:12 am
I see. Does 1 means that we could simply take a huge string and simply move it around instead of using Sub?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 14, 2010, 11:49:10 am
I see. Does 1 means that we could simply take a huge string and simply move it around instead of using Sub?

That's right.  Although you can always stick with Sub when you convert Ti-Basic programs to allow Correlation.

Now the limit is -9999.  You can also specify a negative value for Y coordinates.  The limit is again -9999, although I only see this being used for e^( for values down to -15 for very logical reasons.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 14, 2010, 11:13:53 pm
I see. Thanks for the info. :)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: meishe91 on December 14, 2010, 11:27:57 pm
Hmm, I don't think I really understand the first note ??? Like you can offset a negative value to display but you can only see what would be on screen?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 14, 2010, 11:31:33 pm
Hmm, I don't think I really understand the first note ??? Like you can offset a negative value to display but you can only see what would be on screen?

You can only see what would be on screen, yes.  But say you have a tilemap string 30 characters wide.  ln(-5, 1, Str0) is easier and faster than ln(1,1, sub(Str0,5,16))
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 14, 2010, 11:44:48 pm
Oh nice, it's faster! I was wondering what would be the speed gain. This could be very handy for vertical scrolling games. :D
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: meishe91 on December 15, 2010, 12:10:58 am
Ah ok, that's what I thought you meant :) However didn't you say that word wrapping on the homescreen would be the same as with Output(?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 15, 2010, 09:17:28 am
Ah ok, that's what I thought you meant :) However didn't you say that word wrapping on the homescreen would be the same as with Output(?

I did indeed.  I think I'll provide a way for people to turn word-wrapping off if they want to, though.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: meishe91 on December 22, 2010, 09:07:46 pm
Well how would word wrapping work with you starting a string off screen? Would it wrap and then continue off down at row eight column seventeen? Or would it like be off by default if you start off screen?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 22, 2010, 09:22:52 pm
Well how would word wrapping work with you starting a string off screen? Would it wrap and then continue off down at row eight column seventeen? Or would it like be off by default if you start off screen?

Word wrapping will work just fine if only the X coordinate is negative.  For a negative Y coordinate, the text will wrap AS IF there was more text to display, and continue normally when the first displayable row is reached.

Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: meishe91 on December 22, 2010, 10:07:48 pm
So if you offset the x-coordinate it will wrap like normal and treat it all the same and such but if you offset the y-coordinate it will essentially wrap the entire string over and over again, even if not seen?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 22, 2010, 10:25:42 pm
So if you offset the x-coordinate it will wrap like normal and treat it all the same and such but if you offset the y-coordinate it will essentially wrap the entire string over and over again, even if not seen?

Exactly.  That way you can do something like a bottom-to-top scrolling driving game if you want to
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 23, 2010, 12:38:03 am
I am a bit confused now. With the other topic I saw, would we be able, for example, to wrap the text every 30 character and have scrolling tilemaps in all 4 directions? Or would the maximum be 16 characters per line?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 23, 2010, 12:45:40 am
I am a bit confused now. With the other topic I saw, would we be able, for example, to wrap the text every 30 character and have scrolling tilemaps in all 4 directions? Or would the maximum be 16 characters per line?

There are different modes.  You can do the 30 character thing, but you also have the default wrapping, with 16 characters max.  This is for people who want their text to wrap like normal.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 23, 2010, 01:29:44 am
Ah ok, thanks for the info :)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 27, 2010, 08:52:36 pm
I've had a lot of people ask about the speed of Correlation.  Be aware that since this is a beta, the speed might be different in the final version.

Here's a program I wrote:

For(A,1,100)
Output(1,1,"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
End

Then I timed it.  Afterwards, I added "real(TESTFONT" and changed Output( to ln(, making it a Correlation program.  I timed it again.

Normal Ti-Basic Version: 15 seconds
Correlation Version: 9 seconds
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 28, 2010, 01:02:02 am
Nice, this means 10 times a second. You put the real(TESTFONT outside the For loop, though, I hope, right? :P
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Builderboy on December 28, 2010, 01:27:06 am
Wow thats awesome :D Even if it was the same speed it would still be epic, but now its even cooler :O
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Ranman on December 28, 2010, 01:39:38 am
This is a cool project! Nice work.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 28, 2010, 12:37:13 pm
Nice, this means 10 times a second. You put the real(TESTFONT outside the For loop, though, I hope, right? :P

Yes, I did! :)

Wow thats awesome :D Even if it was the same speed it would still be epic, but now its even cooler :O

Yeah, I'm quite pleased--and surprised--with the results myself!  I am upset about the other slow commands in Ti-Basic, though...I had an unrealistic dream, though a dream nonetheless, that people could create smooth-scrolling 10 FPS Mario with this.  Doesn't look like it's going to happen ;D

Since it won't be hard to add, I'm adding another "advanced users" feature.  You can turn animated tiles on and off!  However, to make the speed of this as fast as possible, this works only with even-numbered tokens starting with Radian, such as Radian, Normal and Eng.  If you have font characters for both Radian and Degree, the two will switch back and forth between each other when animated tiles are turned on.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 28, 2010, 08:19:44 pm
I think tile scrolling will be just fine. One great thing about this really is how you can display tilemaps with tiles of any size. Also animated tiles seems cool. I assume this just swaps between two font files, right? Personally, though, to have animated tiles I generally just set 0 to a variable then do Not(VAR->VAR then use the tile set corresponding to VAR.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 29, 2010, 12:38:49 am
Also animated tiles seems cool. I assume this just swaps between two font files, right? Personally, though, to have animated tiles I generally just set 0 to a variable then do Not(VAR->VAR then use the tile set corresponding to VAR.

Actually, that's a great idea, so that's how I'm going to do it now.  I was going to do it differently, but your idea is much better and more flexible. 

I doubt people will have animated tiles with 8 frames, but that will be the limit.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 30, 2010, 03:14:45 am
Ah ok. Well I was kinda worried what you did was just alternate automatically between two tiles, which would have been a bit hard in BASIC, not to mention the user may want to have the freedom to manually change. 4 frames might be enough, I think. 8 might be good too, if you have scrolling water, although it's not very common in BASIC.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 30, 2010, 10:31:34 am
Ah ok. Well I was kinda worried what you did was just alternate automatically between two tiles, which would have been a bit hard in BASIC, not to mention the user may want to have the freedom to manually change. 4 frames might be enough, I think. 8 might be good too, if you have scrolling water, although it's not very common in BASIC.

I'm thinking 8 for people who want something such as radar screens, clocks and sensors ;)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 30, 2010, 11:31:24 pm
Yeah true, that would be nice :D

The only worry I have is that it would take a lot of space O.O (and even waste some if some maps have several tiles that aren't animated like buildings)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 31, 2010, 12:53:02 am
Yeah true, that would be nice :D

The only worry I have is that it would take a lot of space O.O (and even waste some if some maps have several tiles that aren't animated like buildings)

Ah, but you only need space for the tiles that are animated. ;D  If you have 50 tiles that are not animated and 2 that are, you can have 1 font 52 tiles big and 7 fonts only 2 tiles big.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 31, 2010, 04:49:03 pm
Oh but how would that work? How would the tile data and maps look like? ??? How would it detect which tile has to be animated and which one doesn't?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 31, 2010, 04:54:51 pm
Oh but how would that work? How would the tile data and maps look like? ??? How would it detect which tile has to be animated and which one doesn't?

Let's say that you have two tiles for the characters "A" and "B."  Let's say that "A" displays a tree, and "B" displays water.  You only want the water to move (an animation of 2 frames), not the tree.

So your main font will contain graphical data for both "A" and "B".  Your second font will ONLY contain graphical data for "B."  Correlation will detect this kind of thing automatically.  Does that make sense?

Ln(1,1,"AABBBBAA"  = Tree, Tree, 2-Frame Water, 2-Frame Water, 2-Frame Water, 2-Frame Water, Tree, Tree
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: jnesselr on December 31, 2010, 06:23:45 pm
So does separate fonts mean separate files?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on December 31, 2010, 06:47:18 pm
So does separate fonts mean separate files?

Pretty much. You can use different fonts to display different "pictures".  One font might display a tree for the letter "A", and another might display a rock for the letter "A."  You can have up to 8 open for Correlation to draw animated tiles, but you can display text with only one font at a time.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on December 31, 2010, 07:20:10 pm
Oh but how would that work? How would the tile data and maps look like? ??? How would it detect which tile has to be animated and which one doesn't?

Let's say that you have two tiles for the characters "A" and "B."  Let's say that "A" displays a tree, and "B" displays water.  You only want the water to move (an animation of 2 frames), not the tree.

So your main font will contain graphical data for both "A" and "B".  Your second font will ONLY contain graphical data for "B."  Correlation will detect this kind of thing automatically.  Does that make sense?

Ln(1,1,"AABBBBAA"  = Tree, Tree, 2-Frame Water, 2-Frame Water, 2-Frame Water, 2-Frame Water, Tree, Tree
But how will it detect it? Will the second string look like "  BBBB  "? Because in that case it wouldn't even save a single byte of space.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 01, 2011, 01:11:39 am
Oh but how would that work? How would the tile data and maps look like? ??? How would it detect which tile has to be animated and which one doesn't?

Let's say that you have two tiles for the characters "A" and "B."  Let's say that "A" displays a tree, and "B" displays water.  You only want the water to move (an animation of 2 frames), not the tree.

So your main font will contain graphical data for both "A" and "B".  Your second font will ONLY contain graphical data for "B."  Correlation will detect this kind of thing automatically.  Does that make sense?

Ln(1,1,"AABBBBAA"  = Tree, Tree, 2-Frame Water, 2-Frame Water, 2-Frame Water, 2-Frame Water, Tree, Tree
But how will it detect it? Will the second string look like "  BBBB  "? Because in that case it wouldn't even save a single byte of space.

Oh man, I am not doing well ;D

I hope this helps explain: you won't need a second string.  If you turn on animated tiles and select your fonts in the order you want tiles animated, you only need "AABBBBAA."  Correlation will see the "B", and draw a different frame of the "B" tile everytime the string is drawn.  One string.  So if your single string is drawn 10 FPS, you will see ten frames of animation every second.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: jnesselr on January 01, 2011, 04:25:29 pm
Oh, I get it. So you define B as a tree in the wind by defining B1 as one frame of the tree, and then B2 as the other frame.  But Correlation doesn't use B1 and B2, it only uses B and handles the change in sprites every time you redraw the string.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 01, 2011, 06:04:14 pm
Oh, I get it. So you define B as a tree in the wind by defining B1 as one frame of the tree, and then B2 as the other frame.  But Correlation doesn't use B1 and B2, it only uses B and handles the change in sprites every time you redraw the string.

I think you've got it.  Let's say FONT1000.8xp contains characters for the letters "A" and "B", so "B" will contain one frame of the tree in the wind.  "A" is defined as a rock.  FONT2000.8xp contains the OTHER character for the letter "B", the other frame of the tree.  Notice there's no "A" in FONT2000.8xp.

real(FONT10001  means that FONT1000.8xp is your first font for your animations. real(FONT20002 means FONT2000.8xp is your second font.  Like you said, Correlation uses only "B" and automatically handles the changes in sprites.  Since there's no "A" in FONT2000.8xp, the rock won't move a muscle.


I've decided to describe creating animated tiles in its own chapter.  It's certainly a confusing topic, and I know that now  :angel:
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: jnesselr on January 01, 2011, 06:25:37 pm
Oh, I get it. So you define B as a tree in the wind by defining B1 as one frame of the tree, and then B2 as the other frame.  But Correlation doesn't use B1 and B2, it only uses B and handles the change in sprites every time you redraw the string.

I think you've got it.  Let's say FONT1000.8xp contains characters for the letters "A" and "B", so "B" will contain one frame of the tree in the wind.  "A" is defined as a rock.  FONT2000.8xp contains the OTHER character for the letter "B", the other frame of the tree.  Notice there's no "A" in FONT2000.8xp.

real(FONT10001  means that FONT1000.8xp is your first font for your animations. real(FONT20002 means FONT2000.8xp is your second font.  Like you said, Correlation uses only "B" and automatically handles the changes in sprites.  Since there's no "A" in FONT2000.8xp, the rock won't move a muscle.


I've decided to describe creating animated tiles in its own chapter.  It's certainly a confusing topic, and I know that now  :angel:
Yeah. One feature request, though, is changing tiles.  If you've got a building that's standing in one scene, but gets blown up or something, you could use the same map (text) but different tiles.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 01, 2011, 06:29:05 pm
Yeah. One feature request, though, is changing tiles.  If you've got a building that's standing in one scene, but gets blown up or something, you could use the same map (text) but different tiles.

I'll add that!  The only restriction is that you'll need to have both your original tile and the one you want to change in the same font.  Correlation will simply swap their positions so that you don't lose either one.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on January 01, 2011, 07:56:15 pm
I see I think, but I would probably understand even better if I knew how the data looked like in both font files.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 01, 2011, 08:15:26 pm
I unfortunately won't be able to post how the data looks, but no worries, when I add this to the manual there will be pictures and a much better explination.  Just remember, you only need one string for your map, no matter how many tiles you are animating.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on January 02, 2011, 01:10:20 am
Ah ok, I guess I might understand a bit more about map format, now. Hopefully I'll understand font data easier too, soon.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 04, 2011, 02:04:43 am
Correlation will now be an application.  You will still be able to turn it on and off in your Ti-Basic program if you so desire (so that your calculator runs normally upon exit), or you can install it from a menu like you do with Xlib.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Builderboy on January 04, 2011, 02:15:00 am
Any reason for the transition to App?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 04, 2011, 02:24:33 am
Any reason for the transition to App?

Sure.  :)  In RAM, the program can be shifted around a lot, meaning I'd have to find it all the time (this really slows things down)--and I realize now that there's a chance that the code might take more than 8 KB.  To run an ASM program in archive, it takes a lot of messing around to keep the calculator from locking down.

With an application, the code stays wherever it has been placed.  Also, someone mentioned that it would be nice for people with a lot of RAM clears so that they need only install the application.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on January 04, 2011, 02:35:53 am
I see, well I guess it will be fine as long as it still works while Doors CS BASIC libs are turned ON, since some people might want to use functions from both programs in one, such as the mouse cursor routine. ALso if you say the program may hit 8 KB, I guess it might be best as an APP, because it would take too much RAM otherwise. Most large games already take a lot of RAM to be ran in the first place.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 04, 2011, 02:38:43 am
I see, well I guess it will be fine as long as it still works while Doors CS BASIC libs are turned ON, since some people might want to use functions from both programs in one, such as the mouse cursor routine.

No matter what, you'll be able to use Doors, etc. routines inside your Ti-Basic program.  Outside, it depends.  There's two ways to install Correlation.  You can use 1:Asm(pgrmCORELATE) like the manual says, and that will let you use the mouse cursor routine, etc. anytime, anywhere.  If you choose to install Correlation from a menu, Doors functions will disappear except when used inside of a Ti-Basic program.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on January 04, 2011, 02:46:53 am
Ah ok, well I meant it would be nice for example if we could use Doors CS BASIC libs and Correlation libs in the same BASIC program.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 04, 2011, 02:49:55 am
Ah ok, well I meant it would be nice for example if we could use Doors CS BASIC libs and Correlation libs in the same BASIC program.

Indeed you can! :D  You just need to tell Correlation when to use Doors and when to use Correlation.  It's not hard, but you just need to be aware of this.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on January 04, 2011, 02:53:32 am
Ah ok, but it doesn't erase/overwrite DCS hooks, right?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 04, 2011, 02:58:09 am
Ah ok, but it doesn't erase/overwrite DCS hooks, right?

Man, I'm really sorry DJ, but I'm finding it difficult to explain right now.  :(  If you want to use DSC hooks inside of your Ti-Basic program, that's not an issue.  However, whether you can use them outside of a Correlation program or not depends on how you run correlation.  You'll have to read the final copy of the manual.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on January 04, 2011, 02:59:27 am
Hmm I see. Well what I wondered was if using DCS inside a Correlation program was an issue. THanks for clarifying that part.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 04, 2011, 03:01:08 am
Hmm I see. Well what I wondered was if using DCS inside a Correlation program was an issue. THanks for clarifying that part.

Oh, good, glad I was helpful there :D
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 28, 2011, 03:43:37 am
I apologize for having to toss out some bad news.  There will be an option available for those of you who want to run Correlation with other libraries and ASM programs, (including Xlib, SpriteLib, Celtic III, AppVar, etc.) but if you to so you will need 800 bytes of RAM.  This is to ensure to the fullest that Correlation and any other libraries will work properly.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: jnesselr on January 28, 2011, 07:16:10 am
So if we don't want that, we can just leave it disabled? Will this still work correctly on someone else's calc who has that option enabled?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 28, 2011, 07:30:36 am
So if we don't want that, we can just leave it disabled? Will this still work correctly on someone else's calc who has that option enabled?

You enable it inside of the program.  Basically, if your program uses outside libraries terrible calculator crashes MIGHT occur if you do not enable this option inside of your program.  When the program exits the option is disabled.  So by default it is disabled unless your program turns it on, and then it is disabled when the program is finished running.

I guess what I'm trying to say is, your program will always work no matter what calculator it is being used on, unless the calculator is low on memory.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: ztrumpet on January 28, 2011, 11:28:23 am
Sounds like a good idea - I guess there's only so much Safe RAM.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on January 29, 2011, 01:41:27 am
So basically that 800 byte of RAM will be some sort of arbitrary buffer? Sounds good to me, providing it can be enabled/disabled in-game so the player doesn't have to manually do so. :P
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Xeda112358 on January 29, 2011, 11:28:17 pm
Hmm, actually I like this idea Hot_Dog. Do you mind if I use the idea? I'll give you credit in the readme of BatLib for sparking the idea...
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on January 30, 2011, 12:09:36 am
So basically that 800 byte of RAM will be some sort of arbitrary buffer? Sounds good to me, providing it can be enabled/disabled in-game so the player doesn't have to manually do so. :P

Yeah, it's a buffer that copies appbackupscreen, plus a couple of small other sections.  That way any data that needs appbackupscreen will be intact when it needs to be

Hmm, actually I like this idea Hot_Dog. Do you mind if I use the idea? I'll give you credit in the readme of BatLib for sparking the idea...

I don't mind in the least bit if you use it!  Be my guest!  ;)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Xeda112358 on January 30, 2011, 12:12:51 am
Thanks! I won't be using it immediately, but I plan to when the un-betafied version is released ^-^
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on February 24, 2011, 10:25:56 pm
Another new feature!  Althought sadly, this feature won't be available in the beta version of Correlation.  Sorry, folks

In many, many Ti-Basic Text-Based games, when you draw a single character you need to erase where it was drawn when in moves to another spot.  For instance, in Pokemon Purple and Illusiat 13 and other RPG games, when the character moves to the right the program needs to erase the area where the character of text had been previously drawn.  Otherwise your screen will get clogged with text  0_0

By using int("BY, Correlation will do all this for you, saving program space and speeding up your program.  Just use int("BY, and from that point on every time you draw a character Correlation will erase where the character was previously drawn WHILE PRESERVING THE BACKGROUND.

The catch is you can only use this for one character.  If you try to use this for several moving characters at once you'll get some very...interesting results.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on February 25, 2011, 04:12:25 pm
That is cool. So basically when displaying a char it keeps in memory what was behind it? Or does it just capture the entire screen content? I fear the latter might require a lot of SafeRAM, right?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on February 25, 2011, 06:10:29 pm
That is cool. So basically when displaying a char it keeps in memory what was behind it? Or does it just capture the entire screen content? I fear the latter might require a lot of SafeRAM, right?

It just captures what's behind it, 32 bytes of RAM
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Xeda112358 on February 25, 2011, 06:14:27 pm
Nice! Also, as a side note, I am not going to be finishing that font editor any time soon, as far as I know, sorry. I will get to it eventually even if one already exists, but I am not going to be able to work on it for a while !_!

But yeah, saving the background like that is a pretty cool idea! Also, do the sprite routines draw directly to the LCD, a buffer, or both?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on February 25, 2011, 06:15:57 pm
Nice! Also, as a side note, I am not going to be finishing that font editor any time soon, as far as I know, sorry. I will get to it eventually even if one already exists, but I am not going to be able to work on it for a while !_!

But yeah, saving the background like that is a pretty cool idea! Also, do the sprite routines draw directly to the LCD, a buffer, or both?

Don't worry, take your time on the font editor

The sprite routines draw to a buffer unless you ask Correlation to draw directly to the LCD one character at a time.  The former displays loads of text very fast, the latter displays small amounts of text very fast
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Xeda112358 on February 25, 2011, 06:21:51 pm
Awesome, that could be useful. I like to draw moving sprites directly to the LCD and then update that portion of the screen from the graph buffer.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: ztrumpet on February 25, 2011, 08:07:10 pm
Ooooh, that's cool.  Wonderful idea, Hot Dog! ;D
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on February 25, 2011, 08:23:55 pm
That is cool. So basically when displaying a char it keeps in memory what was behind it? Or does it just capture the entire screen content? I fear the latter might require a lot of SafeRAM, right?

It just captures what's behind it, 32 bytes of RAM
I see, does it work based on the 8x8 grid? For example if your char is located at x,y 39,41 it would keep in memory sprite 32,40, sprite 40,40, sprite 32,48 and sprite 40,48? What if the character is aligned?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on February 25, 2011, 09:04:42 pm
That is cool. So basically when displaying a char it keeps in memory what was behind it? Or does it just capture the entire screen content? I fear the latter might require a lot of SafeRAM, right?

It just captures what's behind it, 32 bytes of RAM
I see, does it work based on the 8x8 grid? For example if your char is located at x,y 39,41 it would keep in memory sprite 32,40, sprite 40,40, sprite 32,48 and sprite 40,48? What if the character is aligned?

I forgot about that.  Okay, 64 bytes of RAM (NOT user RAM) and everything is taken care of.  Thanks for pointing this out to me!
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on February 26, 2011, 02:35:39 am
No problem. One thing I wonder, tho, is what the RAM used is for? I know there's a 16x16 spot to save, meaning 32 bytes of RAM, but what's the other 32?
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on February 26, 2011, 02:37:51 am
No problem. One thing I wonder, tho, is what the RAM used is for? I know there's a 16x16 spot to save, meaning 32 bytes of RAM, but what's the other 32?

Make that 16 bytes (my mistake).  It's for an unaligned 16 x 16 sprite.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on February 26, 2011, 02:39:58 am
16 bytes total? ???
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on February 26, 2011, 02:43:31 am
16 bytes total? ???

48 bytes total, what I meant was not 64 bytes
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on February 26, 2011, 02:44:35 am
Ah ok ty for the clarification :D
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on March 07, 2011, 11:56:28 pm
A thank you goes to graphmastur for his suggestion on "font collections."  You can read about font collections in the new manual,

http://www.omnimaga.org/index.php?action=dlattach;topic=6843.0;attach=6397

but I'm letting everyone know that now that these are finished (no screenshot, sorry), the beta period is all the more closer
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: jnesselr on March 08, 2011, 07:10:54 am
I like being thanked, and think that's a good implementation of it.  Also, the page numbers are kinda off.  It should say page 37 in the TOC, but it only says 36.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on March 08, 2011, 03:07:10 pm
Also, the page numbers are kinda off.  It should say page 37 in the TOC, but it only says 36.

Thanks for pointing that out, because I did ask people to find typos like that :D
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: DJ Omnimaga on March 09, 2011, 03:28:06 pm
Interesting, this might make it easier to switch between sprite palettes in games with this. :)
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on April 13, 2011, 07:54:17 pm
For those of you who are making homescreen games, always use ClrHome when you use Output(, and always use ClrDraw when using ln(.
Title: Re: Correlation: A New Project Aimed at Ti-Basic Programmers
Post by: Hot_Dog on April 16, 2011, 09:07:47 pm
For all the homescreen gamer fans out there, I'm going to do my best to provide access to the default Ti-83+ font or a font specified by the font hook (like fonts created for Omnicalc).  You will use int("KK to select the default Ti-83+ font, and int("LL to use a font from the font hook.