Omnimaga

Omnimaga => Completed => Our Projects => Grammer => Topic started by: Xeda112358 on June 18, 2011, 10:04:53 am

Title: Grammer
Post by: Xeda112358 on June 18, 2011, 10:04:53 am
Latest Version:Grammer v1.14.10.11 (http://ourl.ca/11664/252772)
Latest App version:Grammer 2.31.12.11 (http://ourl.ca/13558/274439)
(may not actually be the latest versions .__.)

Some of y'all may have noticed a few fleeting moments when my sig contained something about "Grammer" so here is pre release. Pretty much, take BASIC ReCode, make it as safe as BASIC, add in lots of cool new features like labels, calls, and executing other programs, and you have Grammer. The best part, this version is going to be nothing like the final product. I plan to add in a program editor with tokens that are not at all like the OS tokens and I plan to add in the ability to add new libraries of commands. For example, I have ideas for graphics libraries and math libraries. Right now, the readme is a mess and I do not expect anybody to be able to code much, yet. However, I have added in some math that is more than simple (square roots, rounded square roots, lcm(, gcd(, nCr, and the like). I have made arbitrary math programs and sub programs with it, games, and other types of programs, but unfortunately I have neither the latest version nor all of my programs. For now, you will have to live with a sample version  >:D

...Also, I am throwing David a bone here... I have designed a sprite routine that can draw sprites to pixel coordinates (not just every 8) and can be multiples of 8 pixels wide  ;D
Title: Re: Grammer
Post by: p2 on June 18, 2011, 10:08:31 am
NICE!
+1
Title: Re: Grammer
Post by: Xeda112358 on June 18, 2011, 10:11:00 am
Haha, thanks! I should clarify "arbitrary math" and say that I made a simple division routine that returned the first 240 digits after the decimal of x/y. The cool part was that it returned the value in whatever base system you wanted it in from base 2 to base 32 :D
Title: Re: Grammer
Post by: p2 on June 18, 2011, 10:16:16 am
I like your first GIF.
I know it wont be hard to program something like that, but it looks really cool!  ;)
Title: Re: Grammer
Post by: Xeda112358 on June 18, 2011, 10:23:06 am
Actually, that uses a still experimantal command. The problem with that is that the sprite format is weird ._. However, since then I have added a very nice circle drawing command that should make it nice and easy. An example of some code is:
Code: [Select]
:0:Asm(prgmGRAMMER
:1→X →Y
:2→X' →Y'
:Repeat getKey=15          ;So press clear to exit
:Circle(Y,X,3,3                ;Draws an inverted circle
:DispGraph
:Circle(Y,X,3,3                ;ReInverts it
:Y+Y'→Y
:If Y>64
:-Y'→Y'
:X+X'→X
:If X>96
:-X'→X'
:End
:Stop

I have not tested that code, but if it doesn't work, you can press [ON] to break the program (A nice update from ReCode).

EDIT: Okay, I have only a minute of computer time left, so I will also mention that I coded this in mnemonics, not hex, and I have some sample programs mixed in with the download.
Title: Re: Grammer
Post by: Munchor on June 18, 2011, 10:39:17 am
Quote
...Also, I am throwing David a bone here... I have designed a sprite routine that can draw sprites to pixel coordinates (not just every  and can be multiples of 8 pixels wide 

Oh great! Awesomeness, BatLib is now even more awesome.

Also Grammer is looking pretty cool :)
Title: Re: Grammer
Post by: mrmprog on June 19, 2011, 11:51:54 am
Recode, but safer!?
YAY! Watching recode crash is both funny and frustrating. By funny I mean displaying random strings and OS menus during crashes, and by frustrating, i mean losing all your progress.

EDIT: I just noticed that the key code chart says Brie. Isn't that your calcs name?
Title: Re: Grammer
Post by: Munchor on June 19, 2011, 12:16:15 pm
Recode, but safer!?
YAY! Watching recode crash is both funny and frustrating. By funny I mean displaying random strings and OS menus during crashes, and by frustrating, i mean losing all your progress.

EDIT: I just noticed that the key code chart says Brie. Isn't that your calcs name?

Brie is indeed her calculator's name.

And to me, Grammer is not just safer, but better, especially the sprite routines, I've always wanted that :D
Title: Re: Grammer
Post by: TIfanx1999 on June 19, 2011, 06:40:52 pm
Wow!  :o That is blazin' fast! Looks wonderful as always Xeda! <3
Title: Re: Grammer
Post by: jnesselr on June 19, 2011, 10:04:59 pm
It looks awesome!
Title: Re: Grammer
Post by: mrmprog on June 20, 2011, 10:34:34 am
This is going to be so great for fast games when it is done.


/me huddles in a corner and starts rethinking all those graphically intense games that he couldnt do in BASIC.
Title: Re: Grammer
Post by: Xeda112358 on July 18, 2011, 02:39:12 pm
Fwahaha... um, let's see, I am not sure if I have added much, but I do indeed have a sprite routine that can draw 8x8 sprites to pixel locations, now, that uses the same data syntax as well as more examples (some of which I still need to get screen shots of).
Title: Re: Grammer
Post by: Scipi on July 18, 2011, 02:51:14 pm
How did I miss this?

Dang I really need to start learning this as well :P

*HOMER-16 mumbles to himself, "So much stuff to learn nowadays"
Title: Re: Grammer
Post by: Xeda112358 on July 19, 2011, 03:47:29 pm
I need ideas for what tokens I should add for making variables as well as other ideas for commands. I think I will make the Pt-Change( token draw tilemaps.... So, does anybody have ideas? I eventually plan to make a program editor with its own token set, but for now, Grammer 1 must rely on the OS :/
Title: Re: Grammer
Post by: LincolnB on July 19, 2011, 04:21:19 pm
Forgive my ignorance, but this (Grammer) is an assembly library for TI-BASIC, right?
Title: Re: Grammer
Post by: BlakPilar on July 19, 2011, 04:25:47 pm
I have one word about this: woah. Can't wait till it's done.

For making variables, do you mean using tokens that aren't used too often? If so, maybe dbd(? Perhaps int(?
Title: Re: Grammer
Post by: Scipi on July 20, 2011, 09:58:42 am
I'd second int( or perhaps expr(.

lol looking through the catalog, you could make ►nom( do something. :P
Title: Re: Grammer
Post by: Xeda112358 on August 08, 2011, 02:54:29 pm
Forgive my ignorance, but this (Grammer) is an assembly library for TI-BASIC, right?
Actually it is a programming language as opposed to a library. An assembly program interprets the code instead of the BASIC interpreter. It is probably confusing since I use the TI-BASIC tokens (for now).

I have one word about this: woah. Can't wait till it's done.

For making variables, do you mean using tokens that aren't used too often? If so, maybe dbd(? Perhaps int(?
Well actually, I have been working on another side project for somebody and the project required that I make my own variables. The way I would do this with Grammer is to create a temp string to store variables such as strings, sprites, pictures, lists, et cetera. I have the format for the vars created already and it allows all the vars to be named, to.

Basically I just mean that I have to make variables that are not the BASIC vars. It will let Str1 be seperate from the Str1 in BAIC, for example.

I'd second int( or perhaps expr(.

lol looking through the catalog, you could make ►nom( do something. :P

Hehe, I like that one :D I will try to figure out something for that one... maybe an easteregg for ►nom(►nom())

Now aside from that, I got myself another calculator, because I have been thinking of a fun little link protocol routine that will allow for some seriously cool multi-player stunts... if I can figure out how to use the USB port x.x I have been working with the serial port, but I can only work on WabbitEmu since I do not have a serial cable. Anywho, to give an idea of some of the link commands that I want to add, I want to:
-Send code over from one calc for the other calc to execute
-Send Grammer vars and OS vars
-Force recieve vars or info
-Read/write memory from other calculators
-Synchronize LCDs so that both calcs display the same thing

This will allow for some great multiplayer games, yes? It would require both calcs running Grammer, but it would be a pretty powerful command set... if I can figure out how to use the USB
Title: Re: Grammer
Post by: AngelFish on August 08, 2011, 04:31:43 pm
The USB hardware is pretty complicated and partially undocumented. I'd recommend looking at the relevant WikiTI (http://wikiti.brandonw.net/index.php?title=83Plus:OS:84_Plus_USB_Information#Hardware) page for a general idea.
Title: Re: Grammer
Post by: LincolnB on August 08, 2011, 10:53:45 pm
Forgive my ignorance, but this (Grammer) is an assembly library for TI-BASIC, right?
Actually it is a programming language as opposed to a library. An assembly program interprets the code instead of the BASIC interpreter. It is probably confusing since I use the TI-BASIC tokens (for now).

Like Axe?
Title: Re: Grammer
Post by: BlakPilar on August 09, 2011, 08:37:41 am
Forgive my ignorance, but this (Grammer) is an assembly library for TI-BASIC, right?
Actually it is a programming language as opposed to a library. An assembly program interprets the code instead of the BASIC interpreter. It is probably confusing since I use the TI-BASIC tokens (for now).

Like Axe?

Yes. (Methinks)
Title: Re: Grammer
Post by: JosJuice on August 09, 2011, 10:51:56 am
Forgive my ignorance, but this (Grammer) is an assembly library for TI-BASIC, right?
Actually it is a programming language as opposed to a library. An assembly program interprets the code instead of the BASIC interpreter. It is probably confusing since I use the TI-BASIC tokens (for now).

Like Axe?

Yes. (Methinks)
Axe is a compiled language, and Grammer is an interpreted one.
Title: Re: Grammer
Post by: ralphdspam on August 09, 2011, 11:04:44 am
How did I miss this?

Wow, sounds awesome!  And yes, the USB commands would be great!  :D
Title: Re: Grammer
Post by: LincolnB on August 09, 2011, 10:59:50 pm
Axe is a compiled language, and Grammer is an interpreted one.

Will it be able to compete speedwise with Axe and/or ASM? Cause thats cool.
Title: Re: Grammer
Post by: Scipi on August 09, 2011, 11:22:10 pm
ReCode was as fast as Axe. If not, possibly slightly faster (from what I saw)

If Grammer is based off of ReCode, then yes. As fast as Axe.
Title: Re: Grammer
Post by: ralphdspam on August 10, 2011, 12:22:40 am
ReCode was as fast as Axe. If not, possibly slightly faster (from what I saw)

If Grammer is based off of ReCode, then yes. As fast as Axe.
Theoretically, Axe should be faster, but I digress.

Grammer is WAY faster than TI-BASIC, and that's what counts. :) (As both are interpreted languages)
Title: Re: Grammer
Post by: willrandship on August 10, 2011, 12:39:52 am
It's probably simply that it's easier to code well in ReCode than Axe, but Axe is more rewarding for the dedicated. Sort of like Java compared to C++.
Title: Re: Grammer
Post by: Xeda112358 on August 10, 2011, 03:11:01 pm
I think speed wise, Axe should be a little faster, but memory-wise, Grammer code should be able to get the job done, smaller. However, I have plans for "tokenisation." This will be kind of like compiling, but not really. Even so, this will make Grammer about as fast as Axe or Assembly while possibly using less memory than a TI-BASIC program. What it would do is convert all numbers, values, offsets, and arguments directly to hex, that way it no longer gets converted on the fly and label names and comments can be taken out.

As a side note, the only work that I have put into this in a while was only to allow the user to use hexadecimal or decimal inputs. I don't think I have added anything else...

Back to the USB topic, I was looking through the USB code in the OS and jeez is that a lot to take in. I now wish I had a cord for the serial port that worked x.x Anywho, USB communications would be pretty awesome, but it looks very complicated (the way TI does it). I thought it would be simple and be like the serial port except sending more bits at a time !_!
Title: Re: Grammer
Post by: Munchor on August 10, 2011, 03:16:19 pm
OH MY GOD IT'S ZEDA, ONLY 19 DAYS TILL YOU RETURN :D :D :D :w00t:

Now back to topic :P, the USB is well-documented (by us, not by TI), but is indeed very complex.

Also it shouldn't be compared to Axe because it's not compiled, but I think BatLib was just as fast as non-optimized Axe.

The best about Grammer over Batlib (I must resay) is the extra columns :D
Title: Re: Grammer
Post by: Xeda112358 on August 10, 2011, 04:44:23 pm
Thanks :D I think I learned a lesson, though-- Even if I do not have the coding experience for a feature now, I should at least try to give the possibility that I will have the ability in the future. I think with ReCode/BatLib, I should have at least allowed the user to input pixel coordinates even if it couldn't draw to all pixel coordinates... At the moment, I am looking at some of the documentation and I will be saving it to my computer for when I do not have internet.
Title: Re: Grammer
Post by: yunhua98 on September 14, 2011, 10:45:57 am
congratz on the feature!

btw, program execution is a little complicated, but the main problem I have with it is Grammer being a program causes some issues for people like me who use Axe a lot and get RAM clears often. 
Title: Re: Grammer
Post by: ztrumpet on September 14, 2011, 04:58:14 pm
I know I'm a little late to respond here, but your local Radio Shack should have a 2.5 mm to 2.5 mm male to male cable.  This is what the calc uses, and if you really want one, there's one there.
Or you can be like thepenguin: Make an 84 transfer to an 83 from the 84's usb, through a silverlink, and into the 83 to remotly fix his Certificate. O.O

My vote is for these routines to work over the I/O port.  This will ensure 83+SE and 83+ compatibility.
Title: Re: Grammer
Post by: Xeda112358 on September 14, 2011, 05:02:21 pm
Yeah, I can see that and I do plan to eventually turn it into an app when I have time :) I personally am one that likes things like Grammer to be an app, but the advantage to having it as a program is for people who make games and don't want to send an app with it. When I do make the app version, I will have to change some things around (especially the SMC code :O ) and I will probably throw in a few features (like a menu to run programs from and executing archived programs).
Title: Re: Grammer
Post by: ztrumpet on September 14, 2011, 05:11:10 pm
I will have to change some things around (especially the SMC code :O )
Couldn't you just copy parts of the code to places like the SaveSScreen and execute it there?
Title: Re: Grammer
Post by: DJ Omnimaga on September 14, 2011, 05:12:23 pm
This is awesome and congrats for the feature and interview. I think this definitively deserves Omni front page news as well. :) (along with Zelda 68k revival)
Title: Re: Grammer
Post by: calc84maniac on September 14, 2011, 05:13:20 pm
I will have to change some things around (especially the SMC code :O )
Couldn't you just copy parts of the code to places like the SaveSScreen and execute it there?
It depends on whether the SMC optimization is enough to balance the overhead of copying the code to RAM.
Title: Re: Grammer
Post by: Xeda112358 on September 14, 2011, 05:46:54 pm
Yeah, there were parts that I had planned to copy to RAM anyway (to TempSwapArea, though, or whatever it is called), so I will probably copy any heavily used, small routines there or just copy it like the OS does (copy the calls to RAM as needed). Thanks!
Title: Re: Grammer
Post by: BalancedFury on September 14, 2011, 09:00:12 pm
NICE!
+1
Wow it's amazingly fast!
+1
Title: Re: Grammer
Post by: Xeda112358 on September 15, 2011, 09:23:46 am
Thanks guys :) Okay, I will see if I can add at least something today (maybe a screen scrolling method?)
Title: Re: Grammer
Post by: Yeong on September 15, 2011, 11:25:10 am
I just bumped into this.
It looks really nice XD
Title: Re: Grammer
Post by: Xeda112358 on September 15, 2011, 11:31:05 am
Thanks :)
Also, I didn't notice this yesterday:
I know I'm a little late to respond here, but your local Radio Shack should have a 2.5 mm to 2.5 mm male to male cable.  This is what the calc uses, and if you really want one, there's one there.
Or you can be like thepenguin: Make an 84 transfer to an 83 from the 84's usb, through a silverlink, and into the 83 to remotly fix his Certificate. O.O

My vote is for these routines to work over the I/O port.  This will ensure 83+SE and 83+ compatibility.
I actually now have a cord for the serial port, but my other calculator is on loan, now :/ I can still play around with WabbitEmu, though!

Also, I have the screen shifting working (I am using Tangent( for now). I should be able to come up with a tunnel game soon, now!
Title: Re: Grammer
Post by: Xeda112358 on September 17, 2011, 12:28:33 am
Okay, I think it has been long enough to post an update XD So I did manage to add in the scrolling and I made a tunnel example. Also, I have been having trouble in physics, so I decided to start a little physics simulator and a physics engine. So far it has helped, so I might continue with it :)
Title: Re: Grammer
Post by: Xeda112358 on September 17, 2011, 07:47:02 pm
Sorry for the triple post?

Okay, so here is another example, this time with up to 16 objects bouncing around. There is no collision detection, but I have gotten the idea to make a built in physics engine to Grammer :) This would speed things up, especially once I get to the special things like collision detection.
Question: What token should I use for accessing extended command sets?
Question2: What token should I use to pass arguments to extended command sets?
This way I can make a separate program that is a physics engine instead of bloating up Grammer with things not everybody will use.


So in this example, you can open up the source and change the number of added objects to bounce around (do not set N greater than 15 or less than 1). Otherwise, controls are the same as the previous example :)

As a note, there are 256 bytes of data in the program that are used for the objects, that is why there can be at most 16 objects at a time. Also, set Full1 for 15MHz mode and Full0 for 6MHz mode :)
Title: Re: Grammer
Post by: runeazn on September 17, 2011, 08:15:43 pm
can you add highscore on gtunnel and such?

awesome game who is tha best :P
Title: Re: Grammer
Post by: Xeda112358 on September 17, 2011, 09:40:45 pm
I sure can :) What you can do is when you press enter to run the program, keep holding enter, and then hold mode, then release enter (while still holding mode briefly). This will reset the score :)


-so when the game starts, make sure you are holding enter (you have to press enter to run it, so just keep holding it
-at the same time, hold mode
-release enter, then mode

:)
Title: Re: Grammer
Post by: ztrumpet on September 17, 2011, 10:03:04 pm
I just had a chance to try this, and Zeda, it's amazing.  I really like Grammer.  It appears very polished, and I like how you did it.  I can see myself using this in the future.
Title: Re: Grammer
Post by: Xeda112358 on September 17, 2011, 10:04:46 pm
Thanks :) What do you mean by polished, though? Also, I realised that I should probably make some unoptimised programs because I use some hard to read optimisations sometimes :/
Title: Re: Grammer
Post by: ztrumpet on September 17, 2011, 10:05:47 pm
Things like pressing On makes it go to the exact spot it should go to and things like that.  It still feels a lot like TI Basic.
Title: Re: Grammer
Post by: Xeda112358 on September 17, 2011, 10:08:03 pm
Oh, I see :) I am also wondering if I should put in a way to disable the ON button? If I do, what token should I use?
Title: Re: Grammer
Post by: Yeong on September 30, 2011, 12:58:31 pm
I'm trying it and it's quite nice
*Yeong demands Input(

Title: Re: Grammer
Post by: Xeda112358 on September 30, 2011, 05:23:32 pm
Cool! My only worry is that I looked at your code... and you use some functions that don't exist yet for Grammer O.O
The scary part is that your program works O.O
So clearly Grammer has been programming in its own functions without telling me O.O
Grammer must have artificial intelligence D:

But yeah, I don't have the " and " function included and I saw you used it a few times. Functions that don't exist just get ignored, but still...
Title: Re: Grammer
Post by: boot2490 on September 30, 2011, 05:33:38 pm
Holy shit! That looks better than AXE!!!
How do they compare?

Does it do greyscale?
Title: Re: Grammer
Post by: Xeda112358 on September 30, 2011, 05:35:53 pm
Well Axe is faster, but the code is typically larger.
Grammer is faster than BASIC (usually by a lot), and about the same size code (but it still has lots of optimisations for size and speed compared to BASIC).
Title: Re: Grammer
Post by: Stefan Bauwens on October 01, 2011, 05:29:34 am
I've gotta try this out when I'm finished with Grey. Congrats on the news article by the way, Xeda.
Title: Re: Grammer
Post by: Yeong on October 01, 2011, 09:54:03 am
Cool! My only worry is that I looked at your code... and you use some functions that don't exist yet for Grammer O.O
The scary part is that your program works O.O
So clearly Grammer has been programming in its own functions without telling me O.O
Grammer must have artificial intelligence D:

But yeah, I don't have the " and " function included and I saw you used it a few times. Functions that don't exist just get ignored, but still...
O.O
no wonder the collision wasn't working very well. O.O
I was actually surprised that it worked even though I only put the half of the collision detection O.O

So I have to live with

If condition 1
Then
If condition 2
something
End

for a while?
Title: Re: Grammer
Post by: Xeda112358 on October 01, 2011, 10:24:00 am
Stefan Bauwens: Thanks :) Also, you are almost evil O.O
As long as you need to rely on Ans. Otherwise, you can do something like this:
Code: [Select]
getKey=9
If *C=1
<<code>>
That will be like using getKey=9 and C=1. Likewise, you can do:
Code: [Select]
getKey=9
If +C=1
<<code>>
That will be like using or .
Title: Re: Grammer
Post by: Yeong on October 01, 2011, 10:25:31 am
oh ok.
Another Question: I saw the block eating program. Does it use matrix or list or some sort? If you do, how do I use it?
Title: Re: Grammer
Post by: Xeda112358 on October 01, 2011, 10:35:15 am
It doesn't use lists or matrices, actually :) It just pixel tests :)


EDIT: Okay, this is probably useful to some people... Making sprites isn't the easiest of processes in Grammer, so here is a screeny showing two ways of making sprite data :)
Title: Re: Grammer
Post by: Yeong on October 01, 2011, 10:52:09 am
Are you eventually gonna support list/Matrices?
Title: Re: Grammer
Post by: Xeda112358 on October 01, 2011, 10:59:01 am
Maybe, I am not sure yet. If I do, I will have to create my own variable storage system, which could be interesting. If I make lists, for example, to access the first element, you would need to do something like {L1→A or to access the next element, {L1+2→A because it would really just be an array of data.

I think I could add a way to create your own vars and then use them for data storage :)
Title: Re: Grammer
Post by: Xeda112358 on October 01, 2011, 02:08:05 pm
Sorry for the double post, but Yeong had a few great ideas! The first that I will talk about is accessing OS vars. We can now access the OS vars (A through Theta) in Grammer. We can read the values and write to them by prefixing their names with the imaginary i [2nd][.] then the letter. For example:
Code: [Select]
3→iA
iB→C
That stores 3 to OS var A and then stores OS var B to Grammer var C. So now we can interact better with BASIC programs (especially since Grammer code can be used inside BASIC programs).

So that is pretty neat, yes? So now for the second part of the update: Using multiple conditionals. Before, if you wanted to test, say, if C=5 or Enter is being pressed, you needed to have part of the conditional outside of an if statement:
Code: [Select]
getKey=9
If +C=5
...
This was a pain if you needed to preserve Ans! So now we can do something like this, by adding in a space or a colon between conditions:
Code: [Select]
If getKey=9 +C=5
...
The " +" is like using an OR operation on the two conditions, by the way. Similarly, " *" is like using AND. Also, this is not limited to only two conditions or just If statements. This can be used for While and Repeat loops, too :)
Title: Re: Grammer
Post by: Yeong on October 01, 2011, 02:16:13 pm
Any token changes?
Title: Re: Grammer
Post by: Xeda112358 on October 01, 2011, 02:18:08 pm
What do you mean by token changes?
Title: Re: Grammer
Post by: Yeong on October 01, 2011, 02:18:56 pm
I was just curious if you changed any commands' token. (e.g. Line' -> Line'' )
Title: Re: Grammer
Post by: Xeda112358 on October 01, 2011, 02:20:42 pm
Ah, okay. Well, not yet. I just want to warn that the Line(' command isn't totally complete, though XD
Title: Re: Grammer
Post by: boot2490 on October 01, 2011, 04:39:06 pm
Could you do filled shapes?
Thick lines?
Text outputted one letter at a time? (typewriter style)
Particle effects?
Greyscale?
Title: Re: Grammer
Post by: Xeda112358 on October 01, 2011, 05:19:23 pm
Could you do filled shapes?
Grammer currently does this with rectangles (10 fill methods)
I plan to do this with circles, eventually, too.
Other polygons might be a tad more difficult :/
Thick lines?
Once I actually add in a line drawing routine, I can probably do this :) My main issue is that I try to do things optimally for speed. For example, with rectangles, there is a method to draw the outline of a rectangle and clear the inside. It doesn't draw two rectangles to do this because that could really slow down the routine. Instead, it is its own, completely different drawing method :)
Text outputted one letter at a time? (typewriter style)
This can be done and might be pretty neat :) My question is, should this be a mode or should a special symbol be used in the Text( command to tell it to type that way?
Particle effects?
/me is cunfooz?
Greyscale?
I don't plan to add in built in grayscale, but you can simulate it, still :)

Thanks for the suggestions!
Title: Re: Grammer
Post by: Yeong on October 01, 2011, 09:13:51 pm
Quote
This can be done and might be pretty neat Smiley My question is, should this be a mode or should a special symbol be used in the Text( command to tell it to type that way?
Maybe Text(r ?
Title: Re: Grammer
Post by: Xeda112358 on October 01, 2011, 09:42:16 pm
Okay, I added that in, but I am not sure if this will be permanent... should it be? Here is a screenie as well as the Grammer version with the update...

EDIT: Also, I added a way to change the text display speed of this mode. Use Fix Text( followed by a number (smaller number=faster display)
Title: Re: Grammer
Post by: boot2490 on October 01, 2011, 11:20:24 pm
Wow! That is really fucking awesome! You made that really fast, and it could add a nice effect to some games.
How about /Text(  ? (divided text)

Particle effects, like when there is a blood explosion and the drops fly everywhere, or snow or rain falling down in little pixels. Or fireworks.
Title: Re: Grammer
Post by: Xeda112358 on October 02, 2011, 09:21:37 am
That wasn't too difficult, that is why it was fast XD However, particle effects might be D:

Also, I added the /Text( as another option and I found an issue :( If you tried using Typewriter Textas well as displaying a number or displaying text at the last cursor position, it would not work. So, I fixed that :)
Now Text( has four operators O.O

And I would also like to point out that the only "tricky" part to this was making tokens display one character at a time. Luckily, I use my own text display routine, so it wasn't impossible XD

So now I have a question: What modes should I add? For example, Text Inverse is one I can add. I plan to change modes using Fix, so for example, Fix 1 is text inverse, Fix 0 turns it off. Does anybody else have mode ideas?
Title: Re: Grammer
Post by: Yeong on October 02, 2011, 11:11:29 am
Vertical Text mode?
Title: Re: Grammer
Post by: Xeda112358 on October 02, 2011, 11:13:29 am
How would that work? If it is what I think, I might have to work on a routine for that... :D
Title: Re: Grammer
Post by: Yeong on October 02, 2011, 11:15:52 am
like:
H
e
l
l
o
Title: Re: Grammer
Post by: Xeda112358 on October 02, 2011, 11:17:01 am
I think I can manage that... This will give something to do for a while :D
Title: Re: Grammer
Post by: TIfanx1999 on October 02, 2011, 08:54:31 pm
This is very cool stuff Xeda. I *really* need to get around to trying this out sometime... XD
Title: Re: Grammer
Post by: Xeda112358 on October 02, 2011, 10:28:53 pm
Thanks! :) I still have to get to work on the app version, soon, too. I made one that works except for the self modifying code, so I need to fix that up :)
Title: Re: Grammer
Post by: Yeong on October 04, 2011, 06:56:41 pm
Will you add the feature to use Grammer within BASIC program like ReCode?
Title: Re: Grammer
Post by: Xeda112358 on October 04, 2011, 10:22:17 pm
Actually, that is already possible :) You just add the code after a Stop. For example:
Code: [Select]
.0:Asm(prgmGRAMMER
ClrDraw
Text('0,0,37
DispGraph
Goto Lbl "Stop         ;Jumps to the label named Stop
//HI!
.Stop                    ;The label named Stop
Stop                    ;Exits Grammer
Disp "HELLO!        ;TIBASIC

Also, in other news, I am working on the particle effects suggestion, currently, and I am just stitching up the code and debugging at the moment :) Hopefully we will have water effects to work with in the near future O.O
Title: Re: Grammer
Post by: Yeong on October 04, 2011, 10:25:19 pm
O.o
can it support any-degree sprite rotation? or is it too much to ask? EDIT:45 deg?
also, Array support please. I really want it D:
Title: Re: Grammer
Post by: AngelFish on October 04, 2011, 10:29:13 pm

Also, in other news, I am working on the particle effects suggestion, currently, and I am just stitching up the code and debugging at the moment :) Hopefully we will have water effects to work with in the near future O.O

Would it be possible to have user defined automata rules and multiple particle types?

Also, new avatar  ;D
Title: Re: Grammer
Post by: Yeong on October 04, 2011, 10:30:48 pm

Also, in other news, I am working on the particle effects suggestion, currently, and I am just stitching up the code and debugging at the moment :) Hopefully we will have water effects to work with in the near future O.O

Would it be possible to have user defined automata rules and multiple particle types?

Also, new avatar  ;D
*Yeong's eye explodes
Title: Re: Grammer
Post by: Xeda112358 on October 04, 2011, 10:31:17 pm
Hmm, how would the rules work? DO you have any ideas? I assume there would need to be a life cycle condition and conditions about where to move the particles (with certain levels of precedence).
Title: Re: Grammer
Post by: Xeda112358 on October 05, 2011, 08:08:29 am
I have now added some particle effects to Grammer O.O
Yeong gave a great idea for tokens to use:
R→PR( Clears the Particles (the pixels stay there, though)
R→Ptheta( Executes a cycle (this computes and draws the location of the particles)
R→Px(y,x This adds a particle at pixel position (Y,X)

This only handles up to 383 particles, but it is fast :)

So here is a sample program :) Just press left/right to move the cursor and press down to start dropping particles. Press [CLEAR] to freeze them, press [MODE] to exit :)

prgmPARTEX is 127 bytes O.O
Title: Re: Grammer
Post by: TIfanx1999 on October 05, 2011, 08:17:03 am
Very cool! ;D
Title: Re: Grammer
Post by: Yeong on October 05, 2011, 09:05:40 am
O.O
Great job XD
Title: Re: Grammer
Post by: aeTIos on October 05, 2011, 09:54:23 am
Epic.
Title: Re: Grammer
Post by: Xeda112358 on October 05, 2011, 11:24:40 am
Hehe, Thanks! I plan to add some other options, too, soon. For example, I was making a pipe system to drop the particles in and it reminded me of a game I played a long time ago (Pipe Dreams, I believe). I thought "Wow, it would be cool if I could have the particles travel along mazes or pipes!" So I started thinking about how to do that... and I have an idea that I want to try! Also, I like that I can make an hourglass >.>

This could make some neat effects!
Title: Re: Grammer
Post by: Xeda112358 on October 06, 2011, 01:48:25 pm
Okay, here is a mini update adding the P▶Ry( command to control which particle effect is used. I plan to modify this to allow pointing to a different buffer for when I add the ability to create vars. This way, you can have larger buffers (meaning more particles) and multiple buffers to handle different types of particles :)

So now I need a token to use for creating new variables x.x

So here is the program and a new screenie :)

EDIT: Also, here is the program used in the screenie. It is the same as before except you can use + or - to select the particle type.
Title: Re: Grammer
Post by: Yeong on October 06, 2011, 03:04:23 pm
The previous version had a some kinda problem which 'compressed' my screen D:
did you fix that?
EDIT: How about >DMS ?
Title: Re: Grammer
Post by: Xeda112358 on October 06, 2011, 03:10:46 pm
Hmm, what do you mean by that? I am assuming it wrote an incorrect command to the LCD port to change it to 6-bit mode, but I see nowhere in my code that that could happen...

What where you doing when it compressed it? Like, what program or commands were you using?
Title: Re: Grammer
Post by: Yeong on October 06, 2011, 03:12:06 pm
running your partex program D:
It seems that the graph screen is unstable, and then the screen glitch.
Title: Re: Grammer
Post by: Xeda112358 on October 06, 2011, 03:14:46 pm
Hmm, what is your calculator (83+/84+/SE)?
Title: Re: Grammer
Post by: Yeong on October 06, 2011, 03:15:03 pm
I have 84+SE.
Title: Re: Grammer
Post by: Xeda112358 on October 06, 2011, 03:23:24 pm
Hmm, I am not sure what is wrong :( There are no writes to the LCD port that would cause this, so my only other idea is that it is writing to a RAM address that it isn't supposed to, but I did add in checks to make sure it wouldn't write outside of the screen  :/ I've no clue what is wrong :( Has it done this using the current version? maybe I added the code to prevent writing outside of the screen after releasing the previous version?
Title: Re: Grammer
Post by: calc84maniac on October 06, 2011, 04:18:37 pm
It sounds like there's not enough delay between LCD outputs. It's probably a good idea to use a "safecopy" routine (which waits until bit 7 of port $10 is reset before each output)
Title: Re: Grammer
Post by: Xeda112358 on October 06, 2011, 04:22:13 pm
Okay, I will change that, then :) Thanks!

Also, I am working on adding a feature for particle effects that will let you use other pieces of RAM. However, if I do this, then the current setup won't work (which means my examples won't work and any work done with the particle features won't work with the new version).

Is this okay for people?

EDIT: Actually, never mind, I will just add code to make it all still work :) I will just change the default buffer to appBackUpScreen
Title: Re: Grammer
Post by: awalden0808 on October 08, 2011, 04:34:55 pm
I've been playing around with this language, and I love it. I'm just stuck on sprites.  I've got the sprite program you showed as an example in the included PDF, and I know the last line before the Stop command is some sort of code for the sprite. I've noticed replacing the 01234567 with 10101010 draws a vertical dotted line in the sprite's 8th column. Why is that?  ???
Title: Re: Grammer
Post by: awalden0808 on October 08, 2011, 04:42:45 pm
Okay, now I see binary has something to do with it. Still kinda confused though.
Title: Re: Grammer
Post by: Yeong on October 08, 2011, 04:46:23 pm
it doesnt work like normal hex codes.
for example, token 0 is value 32 in ti-83/84 so its actual value is 32 or something.
Title: Re: Grammer
Post by: DJ Omnimaga on October 08, 2011, 04:46:40 pm
Heya and welcome to the forums awalden0808. Just so you know consecutive posts by the same author in one thread are not allowed within less than a few hours so you have to use the edit button within that time (unless somebody else replied already). I unfortunately cannot help on Grammer, though, as I have never used it. Hopefully Xeda112358 shows up soon and can answer your question(s). :)
Title: Re: Grammer
Post by: awalden0808 on October 08, 2011, 05:09:26 pm
Huh... Alright. Hopefully she responds cause I can't figure it out.
Title: Re: Grammer
Post by: Xeda112358 on October 08, 2011, 05:22:16 pm
Hi and thanks! I was actually gone for about a day and a half and just got back! So let's see, you are having trouble with the sprites? Well as Yeong mentioned, 0=32, but in binary that is 00100000, so 8 zeros would draw an 8x8 sprite of just a column of pixels.

I still need to add a command to use hex data for sprite data, but for now, you can try this:
-Draw the sprite in the upper left corner of the graph screen
-Copy this code to a program and execute it:
Code: [Select]
.0:Asm(prgmGRAMMER
Lbl "SPRITE→A
Pt-On(4,A,0,0,1,8       ;This swaps the data on screen
ClrDraw
Pt-Off(0,A,0,0,1,8       ;Draws the sprite back
DispGraph
Stop
Return                   ;Executed by TI-BASIC
.SPRITE
00000000            ;8 bytes for the sprite data
-When you open up the program, the 00000000 line should be replaced with the sprite data :)

The way this works is that with the Pt-On( command, using option 4 will replace the sprite on the screen with the sprite data (it swaps everything). I hope this helps and it is awesome knowing more people are interested!
Title: Re: Grammer
Post by: awalden0808 on October 08, 2011, 09:27:17 pm
Okay. More questions. I can tell the Pt-On( command is different in Grammer than in BASIC. Do you mind giving me a breakdown of the params?

Also, in the program you just gave me, the "SPRITE->A line stores the line after .SPRITE into A, correct? And if I want to show my sprite in your example program in the PDF (where you can move the sprite around) I just replace the 01234567 with the code?

And the code I'm getting back is really messed up (e.g. + and randM(({->??). It's supposed to be like that, right?

(Scratch the first part. I forgot that command was in the PDF!)
Title: Re: Grammer
Post by: Xeda112358 on October 09, 2011, 09:04:53 am
Also, in the program you just gave me, the "SPRITE->A line stores the line after .SPRITE into A, correct? And if I want to show my sprite in your example program in the PDF (where you can move the sprite around) I just replace the 01234567 with the code?
Okay, here is a breakdown of what it does:
the Lbl "SPRITE→A kind of does what you think. Technically, it stores the memory location of the line after .SPRITE. So a neat biproduct of this is this: Say you have two sprites stored after .SPRITE. If you wanted to access the second sprite, just do A+8 (assuming the sprites are 8 bytes).

So to answer your question about the sprite data, you do simply replace the 01234567. If you wanted to, though, you could do some other crazy things (like make a program to store all your sprites in), but that is a little more advanced :) If you want an example of doing this, feel free to ask!
And the code I'm getting back is really messed up (e.g. + and randM(({->??). It's supposed to be like that, right?
Yes, it is supposed to be like that, which is kind of unfortunate (especially if you wanted to copy the data by hand). I will see what  I can do about adding support for hex data to make your lives a bit easier.
Title: Re: Grammer
Post by: awalden0808 on October 09, 2011, 09:20:08 am
Oh... That makes sense. However when I copy the code from the program you gave me and put it into the moving sprite program I just get a jumbled sprite. I even made it really simple and drew one pixel in the 8th column of the sprite, and copied the code (>DMS???????) (???'s are just three question marks. Silly emoticons...), and got the jumbled picture. For some sprites I draw they come up with something that looks similar to the sprites I drew.  By similar I mean there's a slight resemblance to the smiley face I drew, but it definitely would not get me an A if it were an observational drawing of said smiley face in art class.  :banghead:
Title: Re: Grammer
Post by: Xeda112358 on October 09, 2011, 09:51:08 am
Okay, well you might like this update that I just threw together then :) (And I am sure you won't be the only one to like this!)

Now, when using the Pt-On( or Pt-Off( command, if you want to use hex data, you simply add 8 to the method. For example, to draw using the overwrite method, use a value of 8. So here is an example using a circle:
Code: [Select]
.0:Asm(prgmGRAMMER
Lbl "SPRITE→Z
Repeat A=15
Pt-Off(10,Z,Y,X,1,8             ;Draws an inverted circle
DispGraph
Pt-Off(10,Z,Y,X,1,8             ;Re inverts the circle
getKey→A
X+A=3
-A=2
If >88
X
→X
Y+A=1
-A=4
If >56
Y
→Y
End
Goto Lbl "Stop
.SPRITE
3C4281818181423C
.Stop
Stop

I hope this proves to be useful!
EDIT: Oops, better upload the program :-[
Title: Re: Grammer
Post by: aeTIos on October 09, 2011, 09:53:02 am
hehe. Should really learn this.
Title: Re: Grammer
Post by: Sorunome on October 09, 2011, 10:28:21 am
Maybe i'll try out some day. :)
Title: Re: Grammer
Post by: ztrumpet on October 09, 2011, 10:36:07 am
(>DMS???????) (???'s are just three question marks. Silly emoticons...)
Hey awalden, and welcome to Omnimaga.
If you don't want part of your post to use emoticons you can just type [nobbc] and [/nobbc] around it.
Ex:
Code: [Select]
[nobbc]???[/nobbc]???

@Xeda: Grammer's updates are looking amazing. :D
Title: Re: Grammer
Post by: Xeda112358 on October 09, 2011, 10:42:08 am
Thanks! I was discussing on IRC a few days ago about adding grayscale >.> I don't know if I will add it, but I hear people like it <.<
Title: Re: Grammer
Post by: Sorunome on October 09, 2011, 10:43:51 am
Grayscale would be awesome! That is one of the things I really like when programming on the ti. :)
Title: Re: Grammer
Post by: awalden0808 on October 09, 2011, 12:12:37 pm
Alright.  That's perfect.  I think part of the problem might have been that I didn't put Lbl in front of "SPRITE->D. :-\

Thanks!!!

Now... what to do with this new ability...
Title: Re: Grammer
Post by: Sorunome on October 11, 2011, 08:01:27 am
I got a feature Idea: drawing rectangles! :)
Title: Re: Grammer
Post by: Yeong on October 11, 2011, 08:04:53 am
it already has it: Line(x1,y1,height,width,style), I think
EDIT:
Quote from: Grammer Command List
Line(
This is used to draw rectangles. The syntax for this command is:
Line(x,y,Height,Width,Method
x is a value from 0 to 95 and is the x pixel coordinate to begin drawing at
y is a value from 0 to 63 and is the y pixel coordinate to begin drawing at
Height is a value from 1 to 64 is the number of pixels tall the box will be
Width is a value from 1 to 96 is the number of pixels tall the box will be
Method is what kind of fill you want:
0-White. This turns off all of the pixels of the rectangle
1-Black. This turns on all of the pixels of the rectangle
2-Invert. This inverts all of the pixels of the rectangle
3-Black border. Draws a black perimeter not changing the inside
4-White border. Draws a white perimeter not changing the inside
5-Inverted border. Draws an inverted perimeter not changing the inside
6-Black border, White inside.
7-Black border, Inverted inside.
8-White border, Black inside.
9-White border, Inverted inside.
I needs array support
Title: Re: Grammer
Post by: Sorunome on October 11, 2011, 08:17:31 am
Ok, thanks. I got a different problem, I wanted to test grammer and so i wanted to make a simple program, but it gives a error when executing. The code is:
Code: [Select]
:.0:Asm(prgmGRAMMWE
:
:
:Line(1,1,20,10,1
:
:
:Stop
Grammer is in RAM, when running that program it gives ERR:INVALID
Title: Re: Grammer
Post by: Yeong on October 11, 2011, 08:23:06 am
First, change it to prgmGRAMMER.
Second, add DispGraph after Line. ;)
Title: Re: Grammer
Post by: Sorunome on October 11, 2011, 08:24:29 am
I meant GRAMMER, just typed in accedently wrong! :P Well, it still doesn't work, it jumps to the first line if I press goto error
Title: Re: Grammer
Post by: Yeong on October 11, 2011, 08:25:53 am
is the first line .O or .0?
If it is 0, it shouldn't give you a problem. ???
Title: Re: Grammer
Post by: Sorunome on October 11, 2011, 08:26:25 am
The number zero
Title: Re: Grammer
Post by: Yeong on October 11, 2011, 08:27:29 am
Then it shouldn't give you a problem ???
Try redownloading grammer.
Title: Re: Grammer
Post by: Sorunome on October 11, 2011, 08:28:05 am
OK, i'll do
EDIT: Or do I have to execute grammer once before I can execute that code?
Title: Re: Grammer
Post by: Yeong on October 11, 2011, 08:33:02 am
No you don't. Grammer is a asm library, just like old version of xlib.
Title: Re: Grammer
Post by: Sorunome on October 11, 2011, 08:58:32 am
Is Grammer compatible with DoorsCS?
Title: Re: Grammer
Post by: Yeong on October 11, 2011, 09:00:14 am
I have DSC7 myself, and I don't think grammer has nothing to do with DCS7.(BTW, Grammer should run fine even with DCS7)
EDIT: Wait. Hold on! Did you run the prgmGRAMMER after you made a program?
Title: Re: Grammer
Post by: Sorunome on October 11, 2011, 09:01:18 am
Ok, resending grammer worked, thanks a lot! :)
EDIT: Is there a possibility to let grammer in rom and still execute grammer programs??
Title: Re: Grammer
Post by: Yeong on October 11, 2011, 09:02:35 am
you're welcome XD
Title: Re: Grammer
Post by: Xeda112358 on October 11, 2011, 09:38:23 am
EDIT: Is there a possibility to let grammer in rom and still execute grammer programs??
I plan to make it an APP sometime in the future, so that might be helpful :) I will try to gradually modify Grammer until it will work as an APP, too.

Also, that problem with having to resend Grammer is weird... it must have been a TI-Connect error, I guess.

EDIT: I wonder how I should go about adding array support...
Title: Re: Grammer
Post by: aeTIos on October 11, 2011, 09:47:06 am
Any programming w/o arrays is not a complete one. I'm not kidding, and I also don't want to push you, but really, you should add them in the complete version else no one is gonna use it.
edit: lol, every1 on this page is online now (15:45 GMT+1)
Title: Re: Grammer
Post by: Xeda112358 on October 11, 2011, 10:11:49 am
I don't think there is such a thing as a "complete" programming language, but I do agree that it is needed :) Currently, the user can access memory (reading and writing bytes 8- or 16-bits at a time) so in a way that can be used for array support. I don't believe I documented this in the Commands.pdf file (because this is a way to actually cause a crash if used incorrectly), but I will show how, here:


(x reads a byte at address x. For example, (Lbl "HELLO should return the first byte after .HELLO
{x reads a 16-bit value (little endian) at address x
int(x,a writes a byte (a) to address x
iPart(x,a writes a word (a) to an address (x)


Does this help?
Title: Re: Grammer
Post by: Sorunome on October 11, 2011, 10:55:06 am
EDIT: Is there a possibility to let grammer in rom and still execute grammer programs??
I plan to make it an APP sometime in the future, so that might be helpful :) I will try to gradually modify Grammer until it will work as an APP, too.

Also, that problem with having to resend Grammer is weird... it must have been a TI-Connect error, I guess.

EDIT: I wonder how I should go about adding array support...
I don't know. I use Tilp. Well, the first try that didn't work was the one I dowloaded from the most recent upload in this thread, the second time it was the one from ticalc.org. Well, but maybe it was my calc, it was acting a bit wiered just minuets ago, like executing games just in half the screen etc. :S But it works now. :)
Title: Re: Grammer
Post by: Xeda112358 on October 11, 2011, 08:10:39 pm
Hmm, well that is odd. I checked the most recent download here and it works for me. I am not sure what went wrong, then :/
Title: Re: Grammer
Post by: Yeong on October 11, 2011, 08:11:39 pm
Probably DSC7 caused it.
DCS7 sometimes causes some problem in my calc too.
Title: Re: Grammer
Post by: Xeda112358 on October 11, 2011, 08:16:03 pm
Maybe, but I don't see why. I just tried running a Grammer program from DCS7 and it worked and then I tried running a program with DCS7 active, but from the homescreen and it worked. I don't know what is causing the problem :/
Title: Re: Grammer
Post by: awalden0808 on October 11, 2011, 08:36:55 pm
I use Doors CS 7 and Grammer was working fine.
Title: Re: Grammer
Post by: Xeda112358 on October 12, 2011, 07:16:02 am
So as kind of a side update, I am working on writing/completing an actual tutorial for Grammer. I am also trying to add in a way to execute code as an interrupt (because this will allow for things like grayscale). So pretty much, I need to find a new token for this. I use Goto to jump to a section of code and prgm to execute code as a subroutine, so what do I use to execute the code as an interrupt?

For BASIC programmers, an interrupt in Grammer will mean that a section of code will get executed over 100 times per second along with the normal code flow.
Title: Re: Grammer
Post by: Yeong on October 12, 2011, 07:17:47 am
did you already used int()?
If you didn't, it's probably the best
interrupt XD
Title: Re: Grammer
Post by: Xeda112358 on October 12, 2011, 07:33:06 am
Yeah, I already used that D: Which reminds me, a few posts back I posted a way to use arrays (involving int().

Here is the post link: http://ourl.ca/11664/251481

EDIT: You were looking for a way to do this, right?
Title: Re: Grammer
Post by: Yeong on October 12, 2011, 07:36:00 am
oh. I missed that XP
then how about augment() ?
Title: Re: Grammer
Post by: Xeda112358 on October 12, 2011, 07:39:43 am
I was thinking of using that to increase the size of a var. So for example, to add bytes to the end of a program file in case it has map data or sprite data or something like that.
Title: Re: Grammer
Post by: Yeong on October 12, 2011, 07:41:40 am
hmm
variance() ?
Title: Re: Grammer
Post by: Xeda112358 on October 12, 2011, 07:44:39 am
Wow, that is a token?
Umm, is this on all OSes? (I notice it is a two-byte token)
Title: Re: Grammer
Post by: Yeong on October 12, 2011, 07:45:56 am
It's in List -> Math. and yes. At least, it's in OS 2.43
Title: Re: Grammer
Post by: Xeda112358 on October 12, 2011, 07:48:04 am
Okay, cool. Um, I am looking through the Catalog and I see "Func" as a potential token (like executing a Function)
Title: Re: Grammer
Post by: Yeong on October 12, 2011, 07:50:30 am
That works too XD
Title: Re: Grammer
Post by: Xeda112358 on October 12, 2011, 07:53:11 am
Thanks much Yeong! But now I have to see how I can use the variance( token, because that seems neat... XD
Title: Re: Grammer
Post by: Yeong on October 13, 2011, 10:32:26 am
Quote from: Grammer PDF
Code: [Select]
:Return→A
:int(rand,-1
:Goto A
:D

Don't do this
Title: Re: Grammer
Post by: Xeda112358 on October 13, 2011, 01:55:25 pm
I love that part, yeong :D

Here is an update on the things that have been changed or added:

DispGraph can now have a pointer to tell it which buffer to display. For example, if you want to display appBackUpScreen as a buffer, you can do DispGraphπ9872. To display the normal graph screen, just do DispGraphπ9872 (remember that the pi symbol tells it to read the number as hex). If you omit the argument, it will just display the default buffer.

Disp will let you change the default buffer location. For example, if you want to use appBackUpScreen instead of the graph screen, just do Disp π9872.

Func will let you execute a subroutine as an interrupt. Interrupts activate a little over one hundred times per second, regardless of what is happening code wise. For example, this will automatically display the graph screen, even if you don't have any other DispGraphs in your code:
Code: [Select]
FuncLbl "INTERRUPT     ;the Lbl "INTERRUPT part will return the location of the routine
Repeat getKey=15
rand/1024→Y
rand/683→X
rand/1024→R
Circle(Y,X,R,3
End
Goto Lbl "Stop          ;Jumps to the end of the code
.INTERRUPT
DispGraph
End                   ;Ends the interrupt
.Stop
Stop
Note that this isn't optimised XD

And finally, the Send( command will let you make a program or appvar of any size you want (assuming there is enough memory). So to create the program named HI with 768 bytes (which can be used as a screen buffer):
Code: [Select]
Send(768,"EHI
Programs have a prefix of "E", protected programs have a prefix of "F" and appvars have a prefix of "U"
This also returns the location of the variable in case you are using it for a buffer *cough*

Hopefully the next update will include a readme that is up to date and has more examples/explanations. For now, here is a screenie and the latest version of Grammer. Feel free to ask questions (as well as how to do things)!
Title: Re: Grammer
Post by: boot2490 on October 13, 2011, 02:58:34 pm
It can WRITE TO PROGRAMS!?!?!?!?
(http://boot2490.weebly.com/files/theme/surprise.GIF)
Title: Re: Grammer
Post by: Xeda112358 on October 13, 2011, 03:04:22 pm
Oi, yes it can :) But now it can create them, too!

Also, here is a mini graphic I am proud of that I want to make my avatar >.>
Title: Re: Grammer
Post by: Stefan Bauwens on October 13, 2011, 03:07:50 pm
I like it! :D
Title: Re: Grammer
Post by: boot2490 on October 13, 2011, 03:08:44 pm
AWWWW YEAAHHH!!!
Now we can have the powder game on a CALC!!!
Never say never.
Title: Re: Grammer
Post by: Xeda112358 on October 13, 2011, 03:39:11 pm
:D Is there a place to upload examples like this? Here is a vomiterizer thing that you requested >.>
(http://img.removedfromgame.com/imgs/Vomit Example 0.gif)
Title: Re: Grammer
Post by: boot2490 on October 13, 2011, 04:28:43 pm
That is just immature.
But AWESOME
You could make a beautiful waterfall screensaver.. or a fire screensaver..
So many possibilities...
Bloody gashes in cutscenes
Title: Re: Grammer
Post by: awalden0808 on October 13, 2011, 04:36:13 pm
This is so cool!  If only I knew how to use it...

You need to fix Doors CS 7 compatibility. I've made a Grammer program and ran it in Doors and it reset my RAM. Lucky for me Doors is awesome and can run archived programs.

The particle physics in these animations reminds me of the Falling Sand Game (Java game I used to play a lot). Someone should port it to Grammer.  I might do it to pass the time in math while my math teacher explains everything the wrong way.
Title: Re: Grammer
Post by: Xeda112358 on October 13, 2011, 05:06:25 pm
This is so cool!  If only I knew how to use it...

You need to fix Doors CS 7 compatibility. I've made a Grammer program and ran it in Doors and it reset my RAM. Lucky for me Doors is awesome and can run archived programs.
Hmm the readme explains how to use it somewhat, but not that well. And I am not sure why it isn't working with DCS7 :/


That is just immature.
But AWESOME
You could make a beautiful waterfall screensaver.. or a fire screensaver..
So many possibilities...
Bloody gashes in cutscenes
Haha, nice :D I'm not sure about fire or cutscenes, but...
(http://img.removedfromgame.com/imgs/Waterfall Effect.gif)
:D
Title: Re: Grammer
Post by: parserp on October 13, 2011, 05:11:50 pm
This is so cool!  If only I knew how to use it...

You need to fix Doors CS 7 compatibility. I've made a Grammer program and ran it in Doors and it reset my RAM. Lucky for me Doors is awesome and can run archived programs.
Hmm the readme explains how to use it somewhat, but not that well. And I am not sure why it isn't working with DCS7 :/


That is just immature.
But AWESOME
You could make a beautiful waterfall screensaver.. or a fire screensaver..
So many possibilities...
Bloody gashes in cutscenes
Haha, nice :D I'm not sure about fire or cutscenes, but...
(http://img.removedfromgame.com/imgs/Waterfall Effect.gif)
:D
Ooh very nice. O0
Title: Re: Grammer
Post by: awalden0808 on October 13, 2011, 05:17:08 pm
Hmm the readme explains how to use it somewhat, but not that well. And I am not sure why it isn't working with DCS7 :/
I know how to use Grammer (mostly thanks to you :D), just not int( and everything else you introduced. And I'd loved to read the readme for those things, but since an updated one was not included in the attachments, that would not be possible. :P

I'll keep testing out Grammer with DCS7, and see if I can pinpoint a problem. I love Doors too much to have to switch back to Mirage, and I like Grammer to much to stop using it. :)

Speaking of, anyone know how to duplicate programs on-calc? I'd like to have a backup Grammer that I can keep in the archive if it crashes until Xeda turns it into an app. :D
Title: Re: Grammer
Post by: boot2490 on October 13, 2011, 05:24:25 pm
Welcome, awalden!
Title: Re: Grammer
Post by: parserp on October 13, 2011, 05:50:48 pm
Welcome, awalden!
welcome! you should introduce yourself (http://www.omnimaga.org/index.php?board=10.0).
Title: Re: Grammer
Post by: awalden0808 on October 13, 2011, 06:19:58 pm
Welcome, awalden!
welcome! you should introduce yourself (http://www.omnimaga.org/index.php?board=10.0).
Maybe later. For now I have to read reviews of Whitman's "Leaves of Grass". :P Yeeuck...
Title: Re: Grammer
Post by: Yeong on October 13, 2011, 07:40:02 pm
Hmm the readme explains how to use it somewhat, but not that well. And I am not sure why it isn't working with DCS7 :/
I know how to use Grammer (mostly thanks to you :D), just not int( and everything else you introduced. And I'd loved to read the readme for those things, but since an updated one was not included in the attachments, that would not be possible. :P

I'll keep testing out Grammer with DCS7, and see if I can pinpoint a problem. I love Doors too much to have to switch back to Mirage, and I like Grammer to much to stop using it. :)

Speaking of, anyone know how to duplicate programs on-calc? I'd like to have a backup Grammer that I can keep in the archive if it crashes until Xeda turns it into an app. :D
Save it in group?
Title: Re: Grammer
Post by: Xeda112358 on October 13, 2011, 09:53:57 pm
That is probably the best option.
And thanks much for the compliment, awalden0808! I am working on the readme still and I am changing the setup. I will have a tutorial and a "how things work" at the beginning and then an updated list of features and commands and then any other random info (like key codes, changelog, thanks, et cetera).
Also, thanks much y'all!

[unrelated-ish]
Try to find the easteregg in the next version >.> :D

[/unrelated-ish]
Title: Re: Grammer
Post by: boot2490 on October 13, 2011, 09:59:12 pm
Who else liked Xeda's last pic better? The colorful one?
Title: Re: Grammer
Post by: LincolnB on October 13, 2011, 10:08:38 pm
I laik both
Title: Re: Grammer
Post by: Jonius7 on October 14, 2011, 01:15:05 am
Both of them are very nice.
Title: Re: Grammer
Post by: Yeong on October 14, 2011, 07:17:20 am
I believe that one she's using right now is the particle version of her avatar in UTI
Title: Re: Grammer
Post by: Xeda112358 on October 14, 2011, 08:28:03 am
It is indeed :)
Also, here is an update on how I am coming along with the readme/tutorial

I still need to add in the updated commands and whatnot, but with the tutorial part, I have finished the topics of:
Code: [Select]
Terminology (pointers, strings, pointer vars)
How numbers work in Grammer
How math works in Grammer
How logic expressions work
If blocks
Loops (repeat, while, for)
Labels
Code flow (Goto, Return, prgm)
Strings
I am still working on Sprites,Subroutines, Output, Interrupts, and Data.

Is there anything else I should add? Once I finish it, I plan to upload it to TICalc :)
Title: Re: Grammer
Post by: Yeong on October 14, 2011, 08:54:16 am
int( and iPart( ?
Title: Re: Grammer
Post by: Xeda112358 on October 14, 2011, 08:55:25 am
>.> OKay, I will add those to the readme, but I will just make a note that they could be dangerous if misused :)

EDIT: Tutorial part finished, no to updating command info.
Title: Re: Grammer
Post by: awalden0808 on October 14, 2011, 10:38:00 am
Save it in group?
PERFECT. Thank you.
Title: Re: Grammer
Post by: Xeda112358 on October 14, 2011, 11:53:07 am
I finally have completed the readme/command index/ tutorial after quite a while of procrastination. I hope this helps, folks, and now I can upload the updated version to TICalc :D

Thanks for your patience and for pushing me to finish this XD (oxymoronic?)
Title: Re: Grammer
Post by: Yeong on October 14, 2011, 11:53:29 am
yay :D
EDIT: wow. Hex code sprites works now?
Title: Re: Grammer
Post by: Xeda112358 on October 14, 2011, 11:55:57 am
They do indeed :) I figured it was worth while to add because it would make it easier for people :)
Title: Re: Grammer
Post by: Yeong on October 14, 2011, 12:00:18 pm
yea. Sprite datas like Circle(......Circle(   kinda looked weird
Title: Re: Grammer
Post by: TIfanx1999 on October 14, 2011, 12:00:23 pm
Hooray for Read-mes! I'll give it a look see on my days off this coming week. =)
Title: Re: Grammer
Post by: Xeda112358 on October 14, 2011, 12:02:50 pm
Hooray for Read-mes! I'll give it a look see on my days off this coming week. =)
Cool :D It might be a bit dry, though, just as a heads up XD

yea. Sprite datas like Circle(......Circle(   kinda looked weird
Oh, do you mean how the page separates it? I need to fix that... I was too excited to release it XD
Title: Re: Grammer
Post by: Yeong on October 14, 2011, 12:03:46 pm
No, I meant whenever I converted sprite to data, it gave me a weird stuff like that.
Great that I can use hexcode now XD
Title: Re: Grammer
Post by: Xeda112358 on October 14, 2011, 12:04:39 pm
Ah, okay :D/me still needs to fix the formatting a little >.>
Title: Re: Grammer
Post by: Yeong on October 14, 2011, 12:05:50 pm
yea. also, the current size is 5887, not 5860 XD
Title: Re: Grammer
Post by: Xeda112358 on October 14, 2011, 12:07:15 pm
Oh, oops... Hmm, my calc must not have the most up to date version XD
Title: Re: Grammer
Post by: TIfanx1999 on October 14, 2011, 12:08:09 pm
@Xeda: As long as it provides the necessary info, that's all that's really important. =)
Title: Re: Grammer
Post by: Yeong on October 15, 2011, 01:37:14 pm
I just realized that it can create appvar! Nice!
Title: Re: Grammer
Post by: Yeong on October 15, 2011, 03:46:47 pm
Question : is there a way to store multiple data into appvar at same time?
Title: Re: Grammer
Post by: Xeda112358 on October 16, 2011, 10:12:51 am
What do you mean? Like pictures and particle buffers and arrays? The answer for that is yes :)
For example, to create an appvar with two graph buffers:
Code: [Select]
Send(768*2,"UBuf→A
+768→B
Disp A
Now A and B contain the locations of the buffers and instead of the graph screen being used, the first buffer is used :)

Now aside from that, I have made several updates in the past few days! I finally added the Fill( and Fix tokens :)
So the Fix token is used to set modes. Currently there are two: Inverse text and inverse pixels. Inverse pixels is neat because it displays off pixels as on at the LCD. Inverse text just inverses the text.

The Fill( token has 14 different things it can do all dealing with the graph buffer, currently. They range from inverting the buffer to swapping two buffers to combining buffers using some logic.

Also, grayscale works very nicely on a real calc O.O I made a grayscale drawing program (with 4 shades of gray to draw in). Unfortunately, I tried sending it to my computer and that didn't work and when I took out the batteries to charge them... it crashed x.x

So yeah, if anybody wants to make one, it really does work! Just not so well in WabbitEmu :/

The gist of what I did was I made two buffers and stored their location to H and I. Then I used Disp to swap between buffers when drawing and I made an interrupt that looked like this:
Code: [Select]
.INT
DispGraphH
DispGraphI
End

I will try to remake it XD

I also changed the particle engine a little to delete any particles that went offscreen using an idea that Qwerty.55 gave me on IRC :) So now we can have infinite waterfall animations O.O

Finally, I changed the code around to save a few hundred bytes, so even with all the new additions, the code is now 30 bytes smaller than the last version!  I had a certain 10 bytes of code that got used many times throughout the program, so i just made it a call saving 7 bytes each instance, but using a few more cycles.
Title: Re: Grammer
Post by: Sorunome on October 16, 2011, 10:54:34 am
Downloaded bouth, first download each! I just realised I am in the thanks section, just coz I showed a bit of interest! :O Thanks! (And I am more active in cemetech) I am also thinking of trying to make tetris! :)
Title: Re: Grammer
Post by: Yeong on October 17, 2011, 07:12:58 am
*Yeong demands that she fixes her Line' Command XD
Title: Re: Grammer
Post by: Xeda112358 on October 17, 2011, 08:26:33 am
Hmm, I might need to temporarily make use of a routine from elsewhere :/ I would prefer to make my own, but it will be useful to include soon.

So soon, there should be a working routine and when I get time, I will add in my own version to get a few more options (like thickness and whatnot).
Title: Re: Grammer
Post by: Yeong on October 17, 2011, 08:27:29 am
also, what I was asking earlier was something like this:
can grammer do stuff like: Data(0,1,2,3,4,5,6->A ?
Title: Re: Grammer
Post by: Xeda112358 on October 17, 2011, 08:32:37 am
Not that I know of, yet. What I could do, though, is have it copy a list of data to a location. Would that work? Like A[0,1,2,3,4,5,6 where A points to the location to copy to?
Title: Re: Grammer
Post by: Yeong on October 17, 2011, 08:35:59 am
yes, that would work.
I was keep using stuff like
int(A,0
int(A+1,4
int(A+2,7
...
Title: Re: Grammer
Post by: Xeda112358 on October 17, 2011, 10:46:08 am
Hmm, okay, I can add that. Which token should I use?
Title: Re: Grammer
Post by: Yeong on October 17, 2011, 11:27:02 am
[]? :D
Title: Re: Grammer
Post by: tenseg5 on October 17, 2011, 03:27:14 pm
Here is blockeat with diagonal movements (mode, del, xt,stat), repeat delay, wrap around (F5, 2nd).

blockeat.8xp (http://blockeat.8xp)
Title: Re: Grammer
Post by: DJ Omnimaga on October 17, 2011, 03:41:01 pm
Heya welcome to the forums. Could you update that link because http://blockeat.8xp seems like it won't work.

Also Xeda nice to see you got grayscale to work. Is it even better than Reuben Quest style grayscale?
Title: Re: Grammer
Post by: Yeong on October 17, 2011, 05:28:22 pm
I made another game: Mars Invasion!
You are a spaceship that is destroying the buildings. Destroy all of them before you touch the ground!
2nd to shoot.

EDIT: Is it possible to convert graphscreen to particles if the buffer have less than certain amount of pixel? it'll be awesome if it happens.
Title: Re: Grammer
Post by: boot2490 on October 18, 2011, 11:10:30 am
Cool, but there should be some enemies :/
Title: Re: Grammer
Post by: Yeong on October 18, 2011, 11:19:59 am
You're mixing up with space invaders. Space invaders have enemies. Mars invasion doesn't.
Title: Re: Grammer
Post by: Xeda112358 on October 18, 2011, 11:23:58 am
@DJ_O: I am not sure how the reubens quest grayscale looks, so I am not sure :/ I do know that it does a pretty nice job with 4-level grayscale, but mostly because this uses interrupts.
@yeongJIN_COOL: Wow, that is cool! I can't wait to look at the source to see how you did this! That looks really nice!

@World: I have added in the requests for writing multiple bytes as well as fixing up Line(' :) For the last one, I used the routine Axe uses with a few of my own modifications.
So to write multiple bytes to the address pointed to by B' for example:
Code: [Select]
B'[1,2,3,4
And to draw a line, you can do:
Code: [Select]
Line('X,Y,X',Y'
And if you want to use some other logic (like drawing the pixels off or inverted):
Code: [Select]
Line('X,Y,X',Y',2      ;Draws an inverted line

EDIT:
Also, what do you mean by this? (I am a little confused)
EDIT: Is it possible to convert graphscreen to particles if the buffer have less than certain amount of pixel? it'll be awesome if it happens.

EDIT2: Um, I uploaded the correct version, this time, that has the line drawing routine working properly
Title: Re: Grammer
Post by: Yeong on October 18, 2011, 10:15:29 pm
Also, what do you mean by this? (I am a little confused)
EDIT: Is it possible to convert graphscreen to particles if the buffer have less than certain amount of pixel? it'll be awesome if it happens.
I was asking if you draw something at graphscreen and convert them to particles
Title: Re: Grammer
Post by: Xeda112358 on October 18, 2011, 10:18:54 pm
Hmm, I have been thinking of making it a command... If you look at my avatar, that is what I did there :)
Title: Re: Grammer
Post by: Yeong on October 18, 2011, 10:19:41 pm
*Yeong wants that.
If you need token, use >DMS ?
Title: Re: Grammer
Post by: ztrumpet on October 18, 2011, 10:23:50 pm
(http://www.omnimaga.org/index.php?action=dlattach;topic=9067.0;attach=9898;image)
Would you mind if I ported this to Basic and used it in my Homescreen Game Pack?
Title: Re: Grammer
Post by: Yeong on October 18, 2011, 10:24:28 pm
(http://www.omnimaga.org/index.php?action=dlattach;topic=9067.0;attach=9898;image)
Would you mind if I ported this to Basic and used it in my Homescreen Game Pack?
sure. go ahead! ;D
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 07:40:26 am
Okay, so I will try to add in that Screen→Particles command sometime soon, but for now I am having fun trying to code that game to be faster :D I currently have it going pretty fast (I haven't won the game yet), but it isn't complete XD

EDIT: Here is a screenie of what I currently have
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 07:56:47 am
Okay, so I will try to add in that Screen→Particles command sometime soon, but for now I am having fun trying to code that game to be faster :D I currently have it going pretty fast (I haven't won the game yet), but it isn't complete XD

EDIT: Here is a screenie of what I currently have
You should tell people that there is Full command as well :D
Title: Re: Grammer
Post by: Sorunome on October 19, 2011, 07:57:28 am
WOW, that is incredible fast! :)
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 08:00:34 am
WOW, that is incredible fast! :)
^-^
You should tell people that there is Full command as well :D
Hey people, there is a Full command. :P
Actually, I thought I had put that in the readme, but I apparently forgot :/ I added it way back in June, though x.x So anyhow, Full sets 15MHz, as does Full1. Full0 sets 6MHz and Full2 toggles the speed.

I have it in the next readme, too, by the way
EDIT: Okay, I went through and remade the MARS program to be a bit more optimised and here is what I have :)
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 09:02:25 am
*Yeong lost
Great! XD
Title: Re: Grammer
Post by: awalden0808 on October 19, 2011, 10:38:29 am
I made a pretty ingenious program that gives you the key code upon key press for Grammer.  Since Grammer doesn't have a Disp function I put a Disp function after Grammer is ended. And since variable values don't carry over between Grammer and BASIC, but the graph does, I turned on the pixel (1,X), X being the getkey value, and then in the BASIC code at the end I tested for that coordinate to get the value. Really useful for when there isn't a value chart on hand. I don't have a USB cord with me, but when I do I'll attach the program.

EDIT: I lost the game... :(
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 10:57:30 am
>.> Well, that is a pretty neat way of getting around it. I actually did something similar when I made a prime sieve using Grammer (because it is faster). However, there are actually display functions and you can transfer between OS vars and Grammer vars. Here are some examples:
Code: [Select]
.0:Asm(prgmGRAMMER
Repeat A=15
ClrDraw
Repeat A
getKey→A
End
Text('0,0,A         ;Use Text(' to display numbers
DispGraph
End
Stop
Or you could do:
Code: [Select]
Repeat A=15
0:Asm(prgmGRAMMER
Repeat A
getKey→A
End
A→iA               ;i is the imaginary i, here
Stop
Output(1,1,"      ;2 space here
Output(1,1,A
End
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 11:26:45 am
(http://img.removedfromgame.com/imgs/keycodes.jpg)
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 12:40:59 pm
There is also a chart in the readme >.>
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 12:41:53 pm
My pic was just a easy way to memorize getKey value XP
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 01:28:27 pm
Okay, so I have added by request the factorial token. It pretty much means not(). I will explain in more detail later, but I have to go a few minutes ago XD. Ask yeong or suronome as they were the ones that requested it XD

later I will add the ability for While and Repeat
Title: Re: Grammer
Post by: Sorunome on October 19, 2011, 01:29:13 pm
Hehe, now I count to one of the few grammer experts! :P
Title: Re: Grammer
Post by: Stefan Bauwens on October 19, 2011, 01:59:00 pm
(http://img.removedfromgame.com/imgs/keycodes.jpg)
Lol, I could probably use that.
But it's true, what happened with 5,6,7,8,16 and 24? O_o

EDIT: Evil is involved: 5+6+7+8+16+24=66
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 02:07:28 pm
That is just because of the way the hardware was set up :/ Also, i am working on trying to add the ! for While and Repeat loops, but I don't think it will be working XD

So here is what ! does. If the expression after it is 0, 1 is returned. Otherwise, 0 is returned for example, !3=4 returns 1, !3=3 returns 0.

if you put it before an If statement, instead of checking if the condition (or conditions) are true, it checks if they are false. Have fun :)
Title: Re: Grammer
Post by: Sorunome on October 19, 2011, 02:22:57 pm
Lol, I could probably use that.
But it's true, what happened with 5,6,7,8,16 and 24? O_o

EDIT: Evil is involved: 5+6+7+8+16+24=66
I think 5,6,7 and 8 are for the diagonal directions.
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 03:01:24 pm
Lol, I could probably use that.
But it's true, what happened with 5,6,7,8,16 and 24? O_o

EDIT: Evil is involved: 5+6+7+8+16+24=66
I think 5,6,7 and 8 are for the diagonal directions.
Come to think of it, it is! XD
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 03:25:15 pm
Hmm, now there is an interesting idea... I haven't programmed that in, but I think I could make some special key combinations register... So the diagonal directions are a given, but what should I do for 16 and 24?
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 03:32:02 pm
16=Detects I/0 port
24=Detects USB port(84 only)

Are you gonna eventually add sound as well?
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 03:35:28 pm
Erm, I meant key presses...
And sound... hmm, I could implement some unofficial sound routines. Which tokens should be used?

(I say unofficial because they will need to be modified a bit and won't remain backwards compatible, probably)
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 03:36:26 pm
Erm, I meant key presses...
And sound... hmm, I could implement some unofficial sound routines. Which tokens should be used?

(I say unofficial because they will need to be modified a bit and won't remain backwards compatible, probably)
I know but it would be cool like
getKey(16) returns the value of 1 when I/O port have something connected
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 03:39:02 pm
But that would mean that keys don't register if something like headphones are in the I/O port ... :/
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 03:45:20 pm
oh. nvm then. XP
Title: Re: Grammer
Post by: ztrumpet on October 19, 2011, 05:08:57 pm
I'm not sure if Xeda uses this in Grammer, but the 5-8 being diagonal directions was used first (iirc) in xLib.  Normally 5-8 return nothing, much like 16 and 24.
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 05:09:27 pm
I'm not sure if Xeda uses this in Grammer, but the 5-8 being diagonal directions was used first (iirc) in xLib.  Normally 5-8 return nothing, much like 16 and 24.
oh. that's why 5~8 was so familiar to me XP
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 09:10:12 pm
So I can't seem to get the updated version on my calc to test if pressing all of the arrows will return 16 as a key press, so i will just upload this update, now:

Now, getKey returns theses values for these combinations:
5=Down+Left
6=Down+Right
7=Up+Left
8=Up+Right
16=All directions mashed    (supposed to work, not sure if it does)

Aaand, I figured out a simple solution to get the ! token to work for Repeat and While :)

EDIT: And I notice Awalden0808 has submitted a Grammer program to TICalc, too! Congrats on being the third person to do so! And it is actually kind of fun... If you are reading this, you should make it so the user has to reach the upper right pixel or something :D Or be surrounded on three sides by pixels or something. THen you could turn it into a game... Actually, I might do that O.O
Title: Re: Grammer
Post by: mrmprog on October 19, 2011, 09:31:28 pm
Yay! I finally found some time, so I will try grammer soon!/me will be so confused with all the axe/basic/Recode syntax differences.  ;)
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 09:33:41 pm
Sorreeee :) I tried to keep ReCode and Grammer pretty similar (just safer and more likely to work as expected in Grammer). Though Grammer has had a lot more polishing and a lot more features...

Awesome and good luck! Feel free to ask questions :)
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 11:08:55 pm
so haven't figured out about 24?
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 11:12:52 pm
Not yet, sorry :/ I am trying to think of a useful key combination, but I don't know :/

Also, I am now trying to think of a token to use to insert and delete data from a var. The syntax I want is to have a pointer to the data, an offset, and number of bytes to add or remove.
Title: Re: Grammer
Post by: Yeong on October 19, 2011, 11:14:00 pm
fnInt( ?
Title: Re: Grammer
Post by: Xeda112358 on October 19, 2011, 11:14:51 pm
mmm, maybe :/ I wonder how Axe changes it tokens... ?
Title: Re: Grammer
Post by: Stefan Bauwens on October 20, 2011, 02:39:50 am
IO port detection would be cool.
Can it be that 24 is a button+2nd?
Title: Re: Grammer
Post by: Sorunome on October 20, 2011, 08:37:26 am
I think I know what 16 and 14 are supposed to be... :) the two keys (not existing) right of STAT, so on top of VARS and CLEAR (I know, they don't exist, but I think that these keys would belong there)
Title: Re: Grammer
Post by: Yeong on October 20, 2011, 08:39:46 am
I think I know what 16 and 14 are supposed to be... :) the two keys (not exsisting) right of STAT, so on top of VARS and CLEAR (I know, they don't exist, but I think that these keys would belong there)
fixed 8)

TI surely is weird XP

EDIT: I'm working on a space invaders now.
It's kinda buggy atm, but I'll fix it eventually!
Screenshot:
(http://img.removedfromgame.com/imgs/invaderz.gif)
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 08:48:56 am
I think I would have to save I/O detection for another command :/
And that is what the keys would be if they existed XD
And as a note, all keys pressed will in fact return 16 (I finally got it on my real calc)

Aside from that, I have made a mini update to the version of MARS that I was working on :) It now has 3 difficulty levels. The reason I made this, actually, is because I wanted to show that appvars can act as subprograms, too. The one here is called GLEV and what it does is it lets the user select a difficulty level and set the processor speed.

The difficulties in MARS2 is changed simply by making the ship go slower for easy mode and faster for hard mode while the bullet stays a constant speed.
Title: Re: Grammer
Post by: Sorunome on October 20, 2011, 08:51:14 am
Nice! I might post a screenie of my progress on tetris soon! :)
Title: Re: Grammer
Post by: Yeong on October 20, 2011, 08:51:38 am
O.o
so how do I write program data into appvar?
is it just like
Send(number,"UAPPVAR->A
Get("EPROGRAM->A
?
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 08:55:58 am
You do it the same way you write data to a program :) All I did was make the program in the program editor and then I used Calcsys to change it to an appvar. But if you want an example, here is how to make an appvar that has two screen buffers:
Code: [Select]
Send(768*2,"UBUF→H
+768→I
Now H points to one buffer and G points to the other :) And from there, you can use some Fill( commands to copy the graph screen to a buffer and then you won't need to mess up the graph screen!

O>O I just realised I can add the commands DelVar, Archive , and Unarchive O.O
Title: Re: Grammer
Post by: Yeong on October 20, 2011, 08:56:51 am
O.O
awesome!
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 12:52:11 pm
I was in a programming zone for a little while, so here are a bunch of nice updates:
-Pause If will pause for as long as the statement is true. For example, to Pause for as long as a key is being pressed:
Code: [Select]
Pause If getKey
-!Pause If will pause for as long as the statement is false. So to pause until a key is pressed:
Code: [Select]
!Pause If getKey
-getKey( is used to check if a key is pressed. For example, if Enter is pressed, getKey(9 will return 1.
-Tokens like Pic3 and Str1 will now return a pointer to the respective OS variable.
-Pause will create a delay in hundredths of seconds. For example, Pause 66 will delay for about .66 seconds.
-The sprite routines should now be clipped in the down direction (I will work on more clipping later)

I am not sure if I left anything out, but have fun!
Title: Re: Grammer
Post by: Sorunome on October 20, 2011, 12:54:14 pm
Cool! I have the first download! :D
Title: Re: Grammer
Post by: Yeong on October 20, 2011, 01:01:20 pm
yay updates XD
int(rand+rand,rand  >:D
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 02:03:50 pm
Sorry folks, I hope nobody used the Pt-On( command! I left in some debugging code that will cause it to freeze in an infinite loop. I just uploaded the correct version. Here is the link: http://www.omnimaga.org/index.php?action=dlattach;topic=9067.0;attach=9954
Title: Re: Grammer
Post by: Yeong on October 20, 2011, 04:09:21 pm
also, moving sprites out of the right side of the screen clips(?) it but it's 1 pxl down. can you fix that as well?
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 04:16:50 pm
That might be more difficult to do with how I currently have the sprite routine coded. I think I will fix this eventually, but it might be a while, sorry :/

On another note, I am working on converting Grammer to an APP, but it isn't working properly. I am going to be doing a lot of debugging XD I am pretty sure I have all the SMC removed at this point, but some commands still don't work properly.
Also, with the current setup, the program name must be in Ans and then running the App will execute the program. Once I have all the bugs worked out, I will add a menu to select the programs and whatnot from :)
Title: Re: Grammer
Post by: awalden0808 on October 20, 2011, 05:43:10 pm
Three four questions:

I want to add screenshots of this program I made (http://www.ticalc.org/archives/files/fileinfo/442/44260.html). How could I go about doing that?

What exactly are appvars and how do I use them?

I've been playing around with the particles function in Grammer, and just wanted to know if there was anything else I could do with it, like using the particle physics to make a Line Rider / Free Rider kind of game (acceleration/deceleration).

How can I generate a random number, like randInt( in BASIC?
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 06:22:50 pm
I want to add screenshots of this program I made (http://www.ticalc.org/archives/files/fileinfo/442/44260.html). How could I go about doing that?
For that one, you will want to download WabbitEmu, put your calculator ROM on it, then you go from there. Otherwise, for now, I could try to get you a screeny (by the way, I saw that and liked it :D I even commented a page or so back about it)

What exactly are appvars and how do I use them?
Appvars are variables that can hold any kind of data in them and were originally intended for ASM programs and Apps. In Grammer, you can create an appvar of a given size and use it to store information. Currently, there is no way to resize an appvar, though. So if you want to create an appvar of 64 bytes called Data, you will want to use the Send( command:
Code: [Select]
Send(64,"UData→H
The "U" says it is an appvar (use E for a program, F for a protected program). by doing →H, the location of the data is stored to H for later use :)
I've been playing around with the particles function in Grammer, and just wanted to know if there was anything else I could do with it, like using the particle physics to make a Line Rider / Free Rider kind of game (acceleration/deceleration).
I haven't added in functionality like that, but from looking at your other program, I would suggest trying something like this:
Test the pixel underneath the front of the sled and the spot ahead of it. Also have a variable holding the acceleration.  If the pixel ahead is higher, decrease acceleration by 1. If it is lower, increase the acceleration. Also check the pixel 2 pixels below the front of the sled. If that is also on, you are on an accelerating track, so automatically increase speed by 2.

Also note that once velocity becomes negative, the "front" of the sled and "back" of the sled can be reversed.
How can I generate a random number, like randInt( in BASIC?
In Grammer, you can use rand to generate a random number from 0 to 65535. However, I can add in the randInt( function if that makes life easier :)

In other news, Grammer has been successfully put into App form ! Right now I am working on the menu to select a program to run. Once that is finished, I will release Grammer 2.0!

So I have a question: I am using Brass, so how do I change the name it assigns my app?
Title: Re: Grammer
Post by: awalden0808 on October 20, 2011, 08:09:28 pm
Attached is a level I made today. I'm not done with it yet... I was thinking of making it difficult to return to the start if you fall, so you would have to jump on a bunch more platforms just to get to the start again.

Also, I plan to scale down the playing field by one pixel so there's enough space to mark the x and y coordinates of the goal around the image (the program will start by testing for a turned on pixel in that area, and will store the coordinates into some variables). Implementing the goal into the actual level (with three around it, or something like that) would be too limiting on the level designing. I'll include the original version in the update as well so if the smaller playing window is too restricting the designer can use the original version (shouldn't be, but why not have the option?).

Or I could try converting the DRAW program to Grammer so I can access the 0 coordinates, which are outside the built-in Draw function's range... Which do you prefer?
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 08:18:28 pm
Hmm, I'm not sure, but I think it would be cool to have a drawing program in Grammer code. I have been meaning to make one for a while, but I never got around to it XD

EDIT: Also, I am planning for the release of the Grammer App :) It should be coming later tonight :)
Title: Re: Grammer
Post by: awalden0808 on October 20, 2011, 08:22:31 pm
That can be tomorrow's project! :D Also, curious as to how the Grammer app will work...
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 09:36:26 pm
For those who want the Grammer App, here you go! :)
http://ourl.ca/13558
Title: Re: Grammer
Post by: Yeong on October 20, 2011, 10:39:59 pm
Yay! A app version!
/me don't have to group Grammer every time he backs up now
will it run archived program?
Title: Re: Grammer
Post by: Xeda112358 on October 20, 2011, 10:43:37 pm
No, it doesn't run archived programs yet, sorry :/
Title: Re: Grammer
Post by: awalden0808 on October 21, 2011, 07:03:05 am
USB Communication Error: Flash application has a bad signature.

:(
Title: Re: Grammer
Post by: Xeda112358 on October 21, 2011, 07:36:40 am
grrrr, I think it is because I changed the name using WabbitEmu and then I copied it from Wabbit. Gahh, nobody can seem to tell me how to fix this problem >.<

EDIT: Okay folks, see the Grammer 2 topic again (first post) for a version that is working :)
Title: Re: Grammer
Post by: mrmprog on October 25, 2011, 11:15:43 pm
Ok! I just got all the grammer docs on my kindle,so now i have something to do tommorow. I already have some questions though. Are there only two particle effect? Also,how is stuff stored? if i have "quack" as a string, can i modify it like in Basic,or is it closer to axe?
Title: Re: Grammer
Post by: Xeda112358 on October 25, 2011, 11:40:55 pm
There are currently two particle types, but I am working on adding a few more (including the worm particle I have been promising). And strings cannot be edited like in TI-BASIC, so I am assuming they work similarly to Axe.
Title: Re: Grammer
Post by: mrmprog on October 26, 2011, 10:39:46 pm
Here is the code I was using:
Code: [Select]
:.0:Asm(prgmGRAMMER
:ClrHome
:ClrDraw
:Line('30,30,60,30,1
:DispGraph
:Stop

This has to do with an IRC discussion.
Title: Re: Grammer
Post by: Xeda112358 on October 27, 2011, 12:03:25 am
Okay, so the issue you were having there (as dicussed on IRC) was that the homescreen would fill up with 3x3 squares. The reason was that when I wrote the code for ClrHome, I filled it with that char instead of a space. I have it fixed for the next version.
Title: Re: Grammer
Post by: mrmprog on October 27, 2011, 05:43:55 pm
Ok, glad that will be fixed. After having grammer on my calc for a while(accompanied by some spectacular crashes :) ), I have some things to say. Is it possible to add a feature that lets you control the direction of gravity for particles? Can you put grammer code in a basic program? This is really awesome, I look forward to making some epic stuff with it.
Title: Re: Grammer
Post by: Yeong on October 27, 2011, 05:45:18 pm
Can you put grammer code in a basic program?

it used to. but I don't know about now.
Title: Re: Grammer
Post by: Xeda112358 on October 27, 2011, 05:57:04 pm
When using the program version of Grammer, you can stick Grammer code in a BASIC program. Anything after the Stop is read as BASIC code and you start the Grammer code with a number in Ans then Asm(prgmGRAMMER. This won't work so much with the APP version, yet, but if you use the program I released somewhere around here, it will... Sorry, I am highly distracted at the moment XD
Title: Re: Grammer
Post by: mrmprog on October 27, 2011, 08:52:59 pm
/me is having fun!
Is it possible for us to have custom particle rules? This would probably be really hard, but worth the effort in my opinion.
Title: Re: Grammer
Post by: Xeda112358 on October 27, 2011, 08:54:33 pm
It isn't available yet, but it is possible... >.>
Title: Re: Grammer
Post by: Xeda112358 on November 10, 2011, 08:36:15 pm
Update time!
Okay, with this version, there are some significant updates that will lend to some much needed features and that will help me add new commands.
Bug Fixes:
-Apparently I broke the sprite routines in the last version, but only for the non-hex commands. I fixed it here XD

Updated Commands:
-Now any variable name inputs aren't limited to named vars. For example, "DStr1" is a valid variable name (to access Str1)
-Fix has another mode for Hexadecimal mode. This makes all numbers get read as hexadecimal.

New Commands:
-Asm(
This lets you use an external, squished ASM program
-IS>(
This will use a pointer var to read variable data. It then increments the pointer var.
-Archive
-Unarchive
-Delvar
-solve(
This is actually going to be a command subset. This has currently 3 commands:
solve(0 is used to copy a var from archive or RAM to a new var
solve(1 is used to copy a piece of RAM to another location (copying forward)
solve(2 is used to copy a piece of RAM to another location (copying backwards)

I don't have any real example programs ready that display the new commands in action, but I can see these new commands as being highly useful. For example, using the IS>( command will make it fairly easy to make a parser. I actually made this because I was working on a drawing program that stored the drawing as shapes and commands as opposed to a bitmap.

I would like to add augment( and sub( to resize variables, too.

I hope this works out well for people! Hopefully I can add new sound and particle effects, sometime XD
I am also working on the start of an error handler, but I want to make it like a hook. Like, if you do something that will cause an error, it redirects the code to another part of the program for you to handle.
Title: Re: Grammer
Post by: awalden0808 on November 11, 2011, 07:20:15 am
So I have yet another question. I've got two different control sets for my program (new one uses the Up+Left, Up+Right, etc. key codes.), and I also want to have the ability to save position by sending the coordinates to an appvar. I want it to test for the existence of the variable, then create it if need be, then require a second button press to make sure you really want to save it. I want it to have 4 bytes, the first two is the vertical coords, second horizontal. Then, when another pair of buttons is pressed I want it to recall the coordinates by pulling the first 2 bytes, storing it to the coordinate variable, then recall the last 2 and storing it to the other coordinate variable. Is this possible?
Title: Re: Grammer
Post by: Xeda112358 on November 11, 2011, 08:21:37 am
Okay, I am not too clear on the last part, but saving the coordinates to an Appvar I can do:
Code: [Select]
.0:Return
Send(4,"UCoord→V
{V→X
{V+2→Y
Repeat A=15
iPart(V,X
iPart(V+2,Y
Line(X,Y,6,6,2
DispGraph
Line(X,Y,6,6,2
Repeat A
getKey→A
End
X+A=3
-A=2
-A=5
+A=6
-A=7
+A=8
If >90
X
→X
Y+A=5
+A=6
-A=7
-A=8
-A=4
+A=1
If >58
Y
→Y
End
Stop
That will move a rectangle around the screen saving the coordinates to the appvar Coord. To be honest, though, you only need two bytes for the coordinates here >.>
Title: Re: Grammer
Post by: NikProgrammer on July 06, 2014, 05:01:04 pm
Wow. I just found this and though I think it died... In hope to get a reply: How do I get and learn this?!?!
Title: Re: Grammer
Post by: Sorunome on July 06, 2014, 05:02:48 pm
You can get it here: http://www.omnimaga.org/grammer/latest-grammer-updates/msg299276/#msg299276
I think there is a command list etc in the archive.
Title: Re: Grammer
Post by: aeTIos on July 07, 2014, 06:32:43 am
We have IRC for asking things like that D: I thought Xeda pushed out a necro-update or so.
Title: Re: Grammer
Post by: DJ Omnimaga on July 07, 2014, 10:13:06 am
Although it's harder to find old content via IRC logs than the forums
Title: Re: Grammer
Post by: Eeems on July 07, 2014, 10:26:41 am
Although it's harder to find old content via IRC logs than the forums
Although it's not hard to just ask people who might remember on IRC. Or might have a better idea of what to search for.
Title: Re: Grammer
Post by: Xeda112358 on July 11, 2014, 12:25:35 am
NikProgrammer: Yup, basically what everybody else said. For the most part, Grammer should be safe to use. As long as you don't go too crazy with all the RAM editing functions and hex addresses, you should be fine to just experiment with it.
Title: Re: Grammer
Post by: Sorunome on July 11, 2014, 09:51:58 am
[...] As long as you don't go too crazy with all the RAM editing functions and hex addresses, you should be fine to just experiment with it.
So avoid code that writes random bytes to random byte areas :trollface:
Title: Re: Grammer
Post by: Xeda112358 on July 11, 2014, 09:55:36 am
Yes, actually :P I wrote a program to do just that just to see how long it took to crash XD It took like 20 seconds.
Title: Re: Grammer
Post by: Sorunome on July 11, 2014, 09:56:40 am
Remember when yeoung and me had that as the first line of our progs? :P
Title: Re: Grammer
Post by: Xeda112358 on July 11, 2014, 09:58:49 am
no o.o You mean after the ".0:" ?
Title: Re: Grammer
Post by: Sorunome on July 11, 2014, 10:13:40 am
Yes :P
It was funny.