Omnimaga

Omnimaga => Completed => Our Projects => Grammer => Topic started by: Xeda112358 on October 20, 2011, 09:32:11 pm

Title: Grammer 2-The APP
Post by: Xeda112358 on October 20, 2011, 09:32:11 pm
Latest Major Release Grammer v2.24.02.12 (http://ourl.ca/13558/286889) This may not be up to date (24 February, 2012), but includes documentation.
Latest Minor Release In this case, same as the Latest Major Release. Normally does not include updated documentation

This is Grammer 2-- the App. When you first start it, there isn't much. The menu is by no means pretty and doesn't even give any useful hints for how to use it, but it does get the job done. The real beauty, however, comes in what it provides.

Grammer 2 provides a programming language much like others, but with key differences making it fairly unique. It is an interpreted language with tons of support for graphics and math that results in games and math programs alike. If you have questions, feel free to ask :)

Also, I made a new example for this release :) Enjoy!

(As a note, I haven't actually tested every single command to see if they survived the conversion from program to app, so please report bugs!)
EDIT: First bug found by Awalden: Bad signature. Something went awry with compiling, so the new update should work
Title: Re: Grammer 2-The APP
Post by: mrmprog on October 20, 2011, 09:44:08 pm
Wow! Having grammer as an app makes things much simpler, great job.
Title: Re: Grammer 2-The APP
Post by: Yeong on October 20, 2011, 10:30:59 pm
Great job XD
/me Downloads
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 20, 2011, 10:45:29 pm
Thanks folks :D Now  can take a break for a little while XD
Title: Re: Grammer 2-The APP
Post by: Yeong on October 20, 2011, 10:50:09 pm
really? >:D
Feature Request (New):
Inline ASM support
Inputting Strings
External ASM support
Running archived programs
Sound
Moar Crash codes

/me runs
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 02:03:52 am
nice! I would download now, but i'm in school... -.- But I got a question: Is it the same speed?
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 21, 2011, 07:03:09 am
Archived programs from home. READY GO!!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 07:37:18 am
nice! I would download now, but i'm in school... -.- But I got a question: Is it the same speed?
Yes, it is the same speed :)

EDIT:See the first post for the latest bug caught and fixed.

It also has randInt( that I don't believe works yet and it has AsmPrgm as a token to run assembly programs. So be careful not to try to run programs with that as there first line and aren't Grammer programs!
Title: Re: Grammer 2-The APP
Post by: Yeong on October 21, 2011, 07:59:09 am
hmm. It won't run any programs for me for some reason. 2nd doesn't do anything, and ENTER quits Grammer O.o
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 08:01:46 am
I just tested it on my calc and it worked! What programs do you have and which one did you try to run? What does the first few lines of code look like?
Title: Re: Grammer 2-The APP
Post by: Yeong on October 21, 2011, 08:02:14 am
I run your partex2.
Nothing happens D:

EDIT:Nvm I just realised that partex2 was archived XP
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 08:04:07 am
Okay, so in the next version, I will try to add a way to mark archived programs :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 08:23:02 am
nice! It would be also cool, if you could start the programs from the home screen, of cource the grammer programs would need a special headder.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 08:25:02 am
Hmm, that sounds like a neat idea. If I did that, however, it would interfere with DCS7 and some  other apps. Maybe I could include it as just an option?
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 08:26:03 am
Make it interface with zStart, that app is awesome!
Title: Re: Grammer 2-The APP
Post by: Yeong on October 21, 2011, 08:27:53 am
also, when grammer scrolls through the program, can you make it so it only displays Grammer files?
Since Grammer files have a special header, I think it'll be easy to implement.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 08:30:40 am
Okay :) using the original program, there wasn't really a header needed, you could actually do "EPROG":Asm(prgmGRAMMERto run prgmPROG, but it was a lot easier for releasing to have the .0 option. Anywho, it seems to have become standard to start Grammer programs with .0:, so I will make it only show programs that start with that :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 08:32:21 am
Would it then also be enough if you use JUST put in first line .0 without :Asm(prgmGRAMMER?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 09:13:43 am
Well what if a BASIC program started with .01→A or something? .0: is pretty pointless, so that is why I am going with that :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 09:15:03 am
That sounds logical! :)
EDIT: Why should a program start like that? DelVar or 0-> uses less bytes....
Title: Re: Grammer 2-The APP
Post by: Yeong on October 21, 2011, 09:19:41 am
I think she implenented Delvar into grammer.
I think leaving as it is right now is great.
or...
Spoiler For Spoiler:
ㅠGRAMMER
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 09:20:32 am
Or maybe !GRAMMER
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 09:22:28 am
@Suronome: That is the point :) Nobody would use .0→A, but .01→A is a possibility
@Yeong: Delvar hasn't been added yet, actually
@World: I am still working on the header recognition x.x I have added a bunch of untested code, so I hope it doesn't crash!

EDIT: versions compatible with the program version start with ".0:" I want the app version to be able to run those, too
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 10:46:44 am
Cool! Can't wait for the new upload! :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 01:33:35 pm
Okay folks, here is an updated version with a few more functions and additions :)
-The command randInt( is now in the command list and it works like it would in TI-BASIC (mostly). To get a random integer from 4 to 9, you just use randInt(4,9
-Inline Hex asm support is now included using the AsmPrgm token. For example, AsmPrgmC56069EF0745C1 will display the value of "Ans" on the homescreen

However, more importantly (I think) is that now programs with the header .0: are all that get detected and this includes archived programs as well.
AND, if a program is archived and you try to run it, it will be copied to a temp program called GramTemp and it is run from there.

So folks, there you go and I hope you enjoy it! The next feature I need to add is a hook that allows you to run programs from the homescreen again...
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 02:00:50 pm
I was again the first one to download! :) It is cool that it work now that way, just a homerun feature is missing now! :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 21, 2011, 02:04:28 pm
Okay, well I am about to head to class and then directly after I get to go to a math conference (out of state), so I probably won't be able to do much until late tomorrow or the next day, but I will try to get that up and running, too! The first version won't be compatible with other apps, probably
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 21, 2011, 02:05:07 pm
Ok, still cool!
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 21, 2011, 08:54:53 pm
I was having problems with the App, then I realized you hadn't updated the first post's file. So I downloaded the .8xk you attached and everything worked perfectly.  Just need home screen running!
Title: Re: Grammer 2-The APP
Post by: Hayleia on October 22, 2011, 03:14:45 am
But if you do a homerun hook, could you please make an option to disable it so it doesn't kill zStart ?
Btw, great work on this :D
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 22, 2011, 06:18:19 am
Or just make it work parallel with zStart. :)
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 22, 2011, 08:33:01 am
It's not working for me. I want to work with sprites, so I'm trying to recreate your Sprite program in the pdf. Do I need to add Stop at the end, or is it not working with hex code??? I don't know what's going on...

EDIT: All of my Grammer programs are working fine except for this one. Note that they still say ".0:Asm(prgmGRAMMER" at the top, and I haven't even reinstalled the Grammer program after the multiple RAM clears.

EDIT': I archived it, put a .0: at the top, and now it works fine. I think I might have missed a line or something...  But again, somehow all my other programs which I have yet to edit after downloading the app are still working.

EDIT'': Another RAM clear. I did not edit it at all. But then I went into the program and realized I probably screwed it up by forgetting to reset the getkey variable, which was still @ 15 (Clear, exits the program).  I really think there should be something done about the RAM clears. I can get around it by keeping everything archived (I edit my programs in Doors and then run them from Doors or Grammer), so it's really just a nuisance at this point.

EDIT''': AAAAAAAGGGH!!!! It cleared again. I'm 100% sure I have a 16 bit hexcode in there. It worked fine with 8 bit but 16 bit screwed it up (I think...).

EDIT'''': WTH IS GOING ON??? Adding Stop to the end fixed it. Yep. Stop. At the end. :\

EDIT''''': All that's worked out, but just wanted to let you know that DataSwap for Pt-On( isn't working at all.  Just draws it, doesn't erase it. I don't want to use overwrite and erase, because I want to be able to possibly have a background.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 22, 2011, 08:41:57 am
Hmm, Are you using the very latest version? I don't believe I have a sprite program in the latest one.... In any even, here is an example that I just whipped up that works:
Code: [Select]
.0:Asm(prgmGRAMMER     ;Still using this for later versions
Lbl "SPRITE→Z
0→X
→Y
Repeat A=15
Pt-Off(10,Z,Y,X,1,8
DispGraph
Pt-Off(10,Z,Y,X,1,8
Repeat A
getKey→A
End
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 that helps, I must go for a while, so good luck!
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 22, 2011, 09:09:56 am
I'll try that one out, but just make sure you've got A set to 0 because otherwise it won't enter the Repeat loop.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 22, 2011, 05:54:58 pm
Actually, Repeat loops are different from While loops. Repeat loops check the condition after executing the loop and While loops check the condition before executing the loop.
Title: Re: Grammer 2-The APP
Post by: ben_g on October 22, 2011, 06:30:35 pm
I have put it on my calc, and the app worked great with OS 2.40, but when I updated my OS to 2.55MP, the app worked very slow, and when I select a grammer program and press ENTER, the app just quits.
Title: Re: Grammer 2-The APP
Post by: DJ Omnimaga on October 22, 2011, 09:27:12 pm
Nice to see this is now an app Xeda :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 22, 2011, 10:49:36 pm
Thanks, DJ!

And for the folks that have been waiting for it, here is an update :)
Here are two downloads, the first is prgmGRAMMER that is intended for those who intend to have the Grammer APP on their calc. What it does is call the APP, in order to interpret the program (pretty much, it replaces the program version of Grammer if you have the app using only 57 bytes).

The second is the next version of the Grammer App. It now installs a parser hook that allows you to run Grammer programs from the homescreen, even if they are archived.

As another note, I fixed a bug I found :) The particle system still used some SMC that I forgot to get rid of, so it wouldn't change particle types. Now it works fine :)

Please note that subprograms and whatnot must still be in RAM. Also, is there a token I should add that lets the user copy a program or appvar to RAM? I don't mean Unarchiving it, I mean copying, say, prgmPROG from archive to prgmFROG in RAM.
Spoiler For Controls for Partex 2:
Arrows move the cursor (including diagonals)
[Enter] drops particles
[Clear] freezez particles permanently
[ / ] freezes particle movement temporarily
[ * ] unfreezes particle movement
[ + ] sets particles to "boiling"
[ - ] ses particles to "sand"
[2nd] sets pixels on
[DEL] sets pixels off
[Alpha] clears the screen
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 23, 2011, 02:45:54 am
Sound nice! I was the first one to download the app! :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 23, 2011, 03:14:52 am
Always the first, aren't you? XD I hope it is all in working order now :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 23, 2011, 03:16:24 am
It works! :)
Title: Re: Grammer 2-The APP
Post by: Yeong on October 23, 2011, 07:31:27 am
for a token, you could use variance( :D
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 23, 2011, 07:56:36 am
I got a bug-report: It sometimes just freezes.... and then crashes. I don't know why.... :(
Title: Re: Grammer 2-The APP
Post by: Yeong on October 23, 2011, 08:20:42 am
Feature request:
is there a way so we can use loops within the argument of commands, like:
If Pxl-Test(B+11, For(A,1,7):A:End)
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 23, 2011, 09:41:01 am
Feature request:
is there a way so we can use loops within the argument of commands, like:
If Pxl-Test(B+11, For(A,1,7):A:End)
Genius. Do this. It would help for the goalsetting feature I need to add to the GGRPHJMP program.

Another feature request:
Sprite widths of multiples of 4 instead of 8, considering that's how hex works.  I want to clone Tetris and I want more compact codes instead of C0C0C0C0C0C0C0C0... etc.
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 23, 2011, 11:10:55 am
I want to clone Tetris and I want more compact codes instead of C0C0C0C0C0C0C0C0... etc.
Your a bit late, sorry, I am already almost finished.... If you still want to make one, you could make instead it with rectangles. :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 23, 2011, 04:10:31 pm
Feature request:
is there a way so we can use loops within the argument of commands, like:
If Pxl-Test(B+11, For(A,1,7):A:End)
Hmm, I can try to add the seq( command, then. That would do something similar. It might be an ideal notation for algorithms, too..
Also, I think I want to add a For(' command that doesn't modify a var but executes a number of times. For example, For('100 would execute a loop 100 times (this is just an idea)
Another feature request:
Sprite widths of multiples of 4 instead of 8, considering that's how hex works.  I want to clone Tetris and I want more compact codes instead of C0C0C0C0C0C0C0C0... etc.
Hmm, I like the idea, but I am not sure if/when I will add it. However, that did remind me of some features to add...
For example, you guys know how there are custom font hooks and parser hooks in TI-BASIC? What if I did something similar for Grammer? I would try to make sure Assembly programers and Grammer programmers could set Grammer hooks. I was planning on doing this months ago, but I forgot! I even have the fontset enabled to be easily swapped out by a custom one.


Also, just for those who are interested, I plan to add a text mode that lets you draw ASCII... This is mostly because there are chars in the grammer fontset not normally available >.>
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 23, 2011, 09:07:00 pm
Your a bit late, sorry, I am already almost finished.... If you still want to make one, you could make instead it with rectangles. :)
Or I could make it with... CIRCLES! :O
Title: Re: Grammer 2-The APP
Post by: Yeong on October 23, 2011, 09:09:33 pm
Bejeweled?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 23, 2011, 09:20:16 pm
Wow, cool ideas! for a 4x4 circle, you can just do something like this:
Code: [Select]
ClrDraw
Line(0,1,2,4,2
Line(1,0,4,2,2

And Bejeweled would be neat, but I don't think I could do that XD Connect 4 however...
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on October 24, 2011, 08:12:09 am
Hay, the app version is here! \o/ /me still needs to find time to try this out. D:
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 24, 2011, 10:35:31 am
It would be coo if it wouldn't through an error if a rectangle should be drwan out of screen /returns 0 if a pixel test should be made out of the screen. (Sorry if I'm grinding your nerves......I just felt like writing it here. :) )
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 24, 2011, 05:06:25 pm
Oh, right, sorry! I actually have a version I forgot to upload XD I wanted to add some more before releasing it though, but I do really have a version that has those features finished!

I plan to add worm particles and possibly a few more particle options sometime soon...
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 24, 2011, 09:25:08 pm
Oh, right, sorry! I actually have a version I forgot to upload XD I wanted to add some more before releasing it though, but I do really have a version that has those features finished!
Sprite widths of multiples of 4? :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 24, 2011, 09:29:27 pm
No, not those features, sorry XD Just the ones Sorunome was talking about :/
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 24, 2011, 09:33:02 pm
No, not those features, sorry XD Just the ones Sorunome was talking about :/
Oh... Okay... :( Well, no rush! :D
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 25, 2011, 06:53:51 am
No, not those features, sorry XD Just the ones Sorunome was talking about :/
Cool! Please upload it! :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 25, 2011, 07:59:38 am
Okay, I will after I make these changes:
Adding the Worm particles
Adding in the rectangle routine from BatLib. Apparently the border routines cause the calc to freeze D: At least the BatLib ones will work and it will give you two more methods (shifting the pixels down or up)
Title: Re: Grammer 2-The APP
Post by: Yeong on October 25, 2011, 08:51:30 am
/me  needs a Grammer F&Q Section D:
How do I make program detect if I have a certain appvar or not?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 25, 2011, 08:52:56 am
You would use Get("UNAME
This returns 0 if it exists and if it is archived, it returns a value less than 32768.
Title: Re: Grammer 2-The APP
Post by: Yeong on October 25, 2011, 08:53:29 am
oh. It's not 1. OK. thanks!
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on October 25, 2011, 05:03:41 pm
Hmm... since I'm on vacation this week Ima play around with this and try to get a bare boned battle engine of some sort made with this. ^^
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 25, 2011, 10:04:46 pm
O.O I hope it works out!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 27, 2011, 03:12:16 pm
-ClrHome is fixed so that it now writes all spaces to the homescreen instead of the 3x3 square char.
-There is particle data that will probably crash, so avoid using undocumented particles! (well, particle 2 is okay, 3 causes a crash)
-I fixed up the Line( command because some coordinates were bad and caused the calc to freeze. I just took the one I wrote for BatLib instead, so now there are two more rectangle methods that Sorunome might like! These two will shift a part of the graph screen up or down, so you can now use this in the Tetris program to save a few more bytes!
-pxl-Test( returns 0 if it is off screen
-rectangles are now handled better if they go off the screen (not drawn if their coordinate go below 0 and shortened if part of it goes offscreen)

So now what I need to add:
-Font and Parser hooks
-an Input routine that handles strings
-expr(
-a routine that copies data from one location to another
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 27, 2011, 03:13:23 pm
Cool! (and again I was the first one to download! :D:D:D)
Title: Re: Grammer 2-The APP
Post by: aeTIos on October 27, 2011, 03:13:44 pm
downloading
now
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 27, 2011, 03:16:43 pm
:D I rewrote the end part of Tetris that takes care of shifting the screen and it worked, by the way (cutting out another chunk of bytes). I just used:
Code: [Select]
If H=10
Then
For(H,0,3
Line(4,0,O*4,40,11
End
End
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 27, 2011, 03:17:56 pm
That's a bit shourter! O.o will add imidiatly! :)
Title: Re: Grammer 2-The APP
Post by: aeTIos on October 27, 2011, 03:18:09 pm
that looks cool
Gotta learn grammer asap. Is the doc included in the zip?
(sorry too lazy to unzip)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 27, 2011, 03:19:15 pm
Yes, the readme is included :) It is in PDF form...
Title: Re: Grammer 2-The APP
Post by: aeTIos on October 27, 2011, 03:19:48 pm
Nice.
before asking more, first reading it :)
Title: Re: Grammer 2-The APP
Post by: Yeong on October 27, 2011, 03:29:20 pm
woo! update!
/me  Downloads
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 27, 2011, 06:17:49 pm
Well, I found the first bug, I think x.x I forgot that I changed a piece of the pixel routine that was used by a few routines, so the circle drawing routine doesn't work in that version D: Sorry if anybody needs to redownload x.x
Title: Re: Grammer 2-The APP
Post by: Yeong on October 27, 2011, 06:18:16 pm
/me  redownloads
Title: Re: Grammer 2-The APP
Post by: Sorunome on October 28, 2011, 03:27:38 pm
NNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOO I was not the first one to download! ;( But I download still, want always to have the newest version! ;)
Title: Re: Grammer 2-The APP
Post by: Yeong on October 28, 2011, 07:16:47 pm
NNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOO I was not the first one to download! ;( But I download still, want always to have the newest version! ;)
>:D
Title: Re: Grammer 2-The APP
Post by: awalden0808 on October 31, 2011, 09:25:47 pm
I've fixed up the GRPHJMP program so that it tests for the goal markers in the 0 pixel row and 0 pixel column, and ends the program once you make it to the goal. The way I set it up, it doesn't store anything in the goal variables if a goal isn't specified, so unlimited playing time is still allowed and old levels are unaffected by the update. I have yet to upload it, but I will probably this weekend.

And there are two features I might consider adding. I noticed the special key codes for the up+right / down+right etc. key presses, so I might put the original key tests in a subroutine, do the same for a new one with the two-key presses (I'll get rid of the left/right lock thing), and give the option to use either of the two control sets.

Also, I thought it would be cool if I could set up a program that converts the graph to hexcode, so there would be more storage availability when it comes to levels. It could store the hexcode to a string, or if possible, store it automatically into a program to use as a list. I was hoping there would be a way to send that hexcode to the program, then take the program and read the hexcode from that program, depending on which level you choose (there would be labels, and it could store the hex after the specified label into another variable, to be drawn on the graph).

Let me know if this is possible. I'd like to do away with pictures for level sharing.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 31, 2011, 09:45:26 pm
Hmm, well you can use Grammer to access picvars, if you want. You can also use it to copy picvars to a program or appvar and use to recall later.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 03, 2011, 08:51:40 pm
So it has been a while without an update, but I finally have something that might be nice :) I actually cannot remember exactly what I added, but I know I added these today:
-There is a mode to disable the ON key (Fix 4). This will allow ON to be detected as a key press as 41 or getKey(41) to return 1 if ON is pressed
-Ans can be used as a the value from the last line
-expr( can be used to parse a string as a line of code
-Input can be used for users to input data (you can use delete for backspace, clear to clear, enter to finish) This returns a pointer to the string, so Input →A is valid

So to let the user input a number and store the result in N:
Code: [Select]
expr(Input →N

Oh, and I also added some more fill options O.O I almost forgot about that, but they pretty much draw the screen back on a portion of itself with some logic. This can be used for some fun effects!

So I made an example factorizer thing and a mini graphic for your enjoyment ^-^
Title: Re: Grammer 2-The APP
Post by: mrmprog on November 03, 2011, 08:59:37 pm
 :o Really nice. If I get a chance tomorrow, I will play around with this. I am glad you added the expr command, it will come in handy.
Title: Re: Grammer 2-The APP
Post by: Yeong on November 03, 2011, 10:11:07 pm
awesome!
/me  Downloads
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 03, 2011, 10:14:05 pm
Thanks guys ^-^ I am trying to think up some interesting things I can make or play around with :)
Maybe it is time to remake that Grayscale drawing program...?
Title: Re: Grammer 2-The APP
Post by: ruler501 on November 03, 2011, 10:16:52 pm
is there any kind of tutorial for this yet? Id love to learn it since it sounds very interesting. congratulation on making it
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 03, 2011, 10:18:26 pm
There is a tutorial in the tutorials section and in the download (it is in PDF form and includes documentation of the commands). I also included some programs for examples :)
Also, I just finished making the code to open grayscale pic files :D
Title: Re: Grammer 2-The APP
Post by: Yeong on November 03, 2011, 10:19:12 pm
yay greyscale :D
Title: Re: Grammer 2-The APP
Post by: ruler501 on November 03, 2011, 10:20:11 pm
Thanks and this sounds amazing. ill tell you guys if i manage to make anything worth sharing in it
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 03, 2011, 11:05:54 pm
Cool, please do, and thanks! Also, I have the grayscale drawing finished, so I will upload that soon >:D
Title: Re: Grammer 2-The APP
Post by: Yeong on November 04, 2011, 07:32:04 am
wait is that a pixel clipping O.o
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 04, 2011, 08:18:43 am
Hmm? What do you mean yeong?
Title: Re: Grammer 2-The APP
Post by: Sorunome on November 04, 2011, 08:21:59 am
Wow, cool a new grammer update! I won't download now.....my PC is currently updating to ubuntu 11.10, so after that I'll download it immediately! Oh, and grey-scale would be just EPIC!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 04, 2011, 08:23:28 am
Check out the post for GrayDraw :D The grayscale is nicer oncalc than on Wabbit XD
Title: Re: Grammer 2-The APP
Post by: Sorunome on November 04, 2011, 08:24:01 am
Just did! :D
Title: Re: Grammer 2-The APP
Post by: Yeong on November 04, 2011, 08:28:10 am
Hmm? What do you mean yeong?
the autocell one.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 04, 2011, 08:31:07 am
Haha, nope :D That is like cellular automata :D It is a cool effect I discovered back when I was playing around with xLIB. I just create a pattern by drawing the upper 63 rows with xor logic to the lower 63 rows. For the first 96 iterations, I draw a pixel to the top row, then after that, it just looks like it is moving right in a really neat (and fast) effect!
Title: Re: Grammer 2-The APP
Post by: LincolnB on November 04, 2011, 10:31:08 am
hm...screenie? :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 04, 2011, 01:40:02 pm
Previous page :P
(http://www.omnimaga.org/index.php?action=dlattach;topic=10961.0;attach=10194;image)
Title: Re: Grammer 2-The APP
Post by: LincolnB on November 04, 2011, 10:15:37 pm
Oh, cool. Looks sweet. :)
Title: Re: Grammer 2-The APP
Post by: epic7 on November 08, 2011, 08:56:19 pm
I should try this. What are the advantages of grammer vs. axe?
Title: Re: Grammer 2-The APP
Post by: chattahippie on November 08, 2011, 10:05:37 pm
I should try this. What are the advantages of grammer vs. axe?

Grammer is interpreted, like TI-Basic.
Axe is compiled.
Grammer has smaller programs, usually, but Axe probably has a speed advantage over Grammer
Title: Re: Grammer 2-The APP
Post by: epic7 on November 08, 2011, 10:36:14 pm
I guess I'll try it out
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 09, 2011, 06:55:45 am
chattahippie is correct :) There are some things that can be done much faster with Axe, but Grammer can have a major size advantage over Axe or assembly programs (and even BASIC-- sometimes). Another nice thing is that Grammer programs can be run from Archive (if the Grammer App is installed).

If you check out the Partex 2 example out, that is an example of a program that would probably be a bit large in Axe, but about the same speed :) Still, Axe has its advantages XD

As a progress note, I have added the Asm( command, so now Assembly programs can be run from Grammer programs! I am still working on some family health issues though, so I haven't done much and I haven't been on much :/
Title: Re: Grammer 2-The APP
Post by: Yeong on November 09, 2011, 07:51:44 am
yay. now I can output sound with Grammer XD
Title: Re: Grammer 2-The APP
Post by: Sorunome on November 09, 2011, 07:56:41 am
^Hehe, nice idea! :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 09, 2011, 08:31:52 am
I still think I should add sound commands, though...
Title: Re: Grammer 2-The APP
Post by: Yeong on November 09, 2011, 08:35:07 am
/me have asm program that produce sound depends on the OSVar N,O, and P.
I win :D
I can give ppl the program :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 09, 2011, 08:40:39 am
Ah, okay XD I still wonder how fast it will be >.>
An actual command might be more conducive to making background music via an interrupt (I just wanted to use the word conducive ^-^)
Title: Re: Grammer 2-The APP
Post by: Yeong on November 09, 2011, 08:46:21 am
I tried that with axe.... BAD result XD
Even axe slowed down like hell XP
the best way is output one note per loop.
Title: Re: Grammer 2-The APP
Post by: epic7 on November 09, 2011, 02:32:48 pm
Is grammer also useful for math stuff?


Yeong, Dang you
(http://img.removedfromgame.com/imgs/Bridged.png)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 09, 2011, 03:06:43 pm
It depends on the kind of math you are working with. It cannot use large numbers (should I add a command for that?), but it can run algorithms quickly and efficiently. For example, when I was studying Number Theory over the summer, I made algorithms using Grammer to compute such things as nCr, gcd(), lcm(), prime testing and whatnot (I have added some of those as commands). I have also made a gravity simulator in Grammer code, so that works nicely and I have made several arbitrary precision algorithms (like for the four functions), and I have made algorithms for finding the square root (rounded or not), drawing a circle or line, sine and cosine, and all sorts of other goodies. A lot of these algorithms turned into actual commands that I rewrote in assembly :D

So really, it depends on what you need to do XD The math in Grammer is limited, but it typically returns a lot of info. For example, division returns the rounded down value in Ans which is great for a lot of algorithms and it also returns the remainder in theta prime which is often even better in number theory.

If you have any questions on how to do something, you can post in the Grammer Q&A (http://ourl.ca/13865) topic :D I would love to help with math stuff if I can XD
Title: Re: Grammer 2-The APP
Post by: epic7 on November 09, 2011, 03:08:06 pm
Cool.
(200th post :P)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 10, 2011, 08:42:34 pm
Erm, I accidentally posted the update in the regular Grammer topic, so I am pretty much copying and pasting x.x

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

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
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.

Grammer 2.10.11.11 (http://www.omnimaga.org/index.php?action=dlattach;topic=9067.0;attach=10288)
Title: Re: Grammer 2-The APP
Post by: Yeong on November 10, 2011, 10:05:34 pm
woot update!/me downloads
Title: Re: Grammer 2-The APP
Post by: Hayleia on November 11, 2011, 02:53:44 am
Erm, I accidentally posted the update in the regular Grammer topic, so I am pretty much copying and pasting x.x
Good thing: we can give you twice as much +1s :D
Also, have you checked my signature (new userbar in it) ;D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 11, 2011, 07:02:08 am
:D Cool! That was actually yeong's creation but I asked if I could steal it >.>
I just can't wait to see what comes of this update!
Title: Re: Grammer 2-The APP
Post by: Sorunome on November 11, 2011, 11:26:30 am
Downloaded it! (Check out my int(rand+rand,rand userbar! :P:P:P )
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 15, 2011, 01:11:10 pm
Hey folks, here is a new update that has a rather gorgeous looking command! I have finally added in the Pt-Change( command! It currently only does one Tilemap type, but it does it well. I am going to post a new version of my tilemap editor in its topic and I hope the speed knocks your socks off. Anyway, here is the command syntax and download:
Pt-Change(0,MapLoc,TileLoc,MapWidth,MapX,MapY,TileLogic
0 is the map type (I plan to have other tilemap routines with different syntaxes)
MapLoc is a pointer to the tilemap data. Tilemaps are formed in rows first, then columns
TileLoc points to the 8x8 tile data
MapWidth is the number of tiles wide your map is. The minimum is 12.
MapX is the X offset into the map data to start reading at
MapY is the Y offset into the map data to start reading at
TileLogic is the sprite logic method to use when drawing the tiles. If you want to play with the DataSwap option, back up your sprite data and copy it to a tempvar XD

Also, sprites cannot be in hex form :/ (it would slow things down a tad)
Here is a screeny that shows off some randomly generated maps :D
Title: Re: Grammer 2-The APP
Post by: Yeong on November 15, 2011, 01:11:30 pm
/me grabs it
EDIT: I just realized that the version number got lower O.o
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 15, 2011, 10:17:48 pm
The version number goes 2.day.month.year XD
Title: Re: Grammer 2-The APP
Post by: Yeong on November 16, 2011, 07:19:45 am
ah. XD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 18, 2011, 07:17:00 pm
So what I am working on now is some stuff for circles. I have two ideas for pattern input:

Circle(Y,X,R,t,ON,OFF
ON will be the number of pixels to draw on, then OFF is the number of pixels to draw off. For example, you can draw a circle where 2 pixels are on followed by 3 off, then two on, et cetera.

Option two is:
Circle(Y,X,R,t,Pattern
Pattern will either be a byte or word that contains a bit pattern. So 85 which is 01010101 in binary will draw a circle with every other pixel off.

I prefer the second option as it is much faster, easier, and smaller. I am most likely going to go that route, but I need to figure out if the input should be 8-bit or 16-bit...

Here is a mini example...
As a note, this actually makes a grayscale circle, but I made Wabbit have only 2 shades so you could see what was happening XD

EDIT: I should also note that I rewrote the circles drawing routine. I am pretty sure it is smaller now and it is still as fast :)
EDIT2: Nevermind, it is about 1 to 2 circles slower per second with the added code above D: Still, 45 circles per second >:D
Title: Re: Grammer 2-The APP
Post by: C0deH4cker on November 18, 2011, 07:50:04 pm
Looking good. I might look into grammer, but im learning axe atm.
Title: Re: Grammer 2-The APP
Post by: epic7 on November 18, 2011, 07:50:33 pm
Same....
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 18, 2011, 08:29:04 pm
Cool :D There are a few differences with syntax (especially math), but learning Axe should help you to understand the more advanced functions in Grammer :)

(such as memory editing and access and whatnot)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 21, 2011, 01:03:34 am
Okay, so update-wise, before I make the next official release, I want to put this out for testing. It seems there have been a lot of issues lately (mostly sprites). I have been hard at work making sure these bugs have been fixed (I am not sure they have been, though) as well as making sure these next commands are safe and in working order. Anyway, here are the next commands:
sub( deletes data from a variable. The syntax is:
sub(#ofbytes,Offset,"VarName
So an example of using this might be to delete 7 bytes from the beginning of an appvar:
Code: [Select]
sub(7,0,"UAvar
This code should not delete any data from outside the program. If you try to delete 7 bytes of the last 3 bytes of the var, only the last 3 are deleted. If you try to delete 4 bytes and there is only 1 byte left in the var, only that 1 byte is deleted. See below for negative effects.
augment( is used to insert data into a variable. It has the same syntax as sub( and it will cause a memory error (see next command) if there is not enough memory available.
solve(3, is used to create a Custom Error Handler. The argument for this is a pointer to the error handler. Whenever Grammer throws an error (there is a Memory error and ON Break error), code will be diverted here. The error code is passed in Ans as either 0 for ON or 1 for Memory. For example, here is an error handler that will display the error if ON is pressed and then quit and a menu to quit or continue for a Memory error:
Code: [Select]
.0:
ClrDraw
0→A
solve(3,Lbl "EH
Repeat 0
augment(120,0,"EB
Text('0,0,A
A+1→A
DispGraph
End
.EH
→Ɵ'       ;Stores the error code to Ɵ'
Disp π9872       ;so that we don't mess up the graph buffer
ClrDraw
If !Ɵ'
Text(º"ERR:BREAK":DispGraph:Stop
Text(º"ERR:MEM
Text(6,1,"Ignore
Text(12,1,"Quit
1→Z'
Repeat getKey(54       ;Use 2nd to select an option
Line(0,Z'*6,6,28,2
DispGraph
Line(0,Z'*6,6,28,2
Repeat getKey
End
2*getKey(1 +getKey(4
If                      ;There is a space here
→Z'
End
If Z'-1
Stop
Disp π9340
End
solve(3,0 will reset the handler so Grammer handles it.
Here are the changes and bug fixes:
-Changed the Send( command so that it now creates a var filled with zeros (instead of unknown data)
-Changed UnArchive command to return a pointer to the var data in RAM
-Fixed Pt-On( and Pt-Off( command up (any bugs that I found).

So the negative effects of augment( and sub( deal with the fact that these might shift your program around in memory. Don't worry, this won't affect the parser, but what it can do is mess around with labels. For example, if you get the pointer to a label and store it to P, then you delete some data from a var and your program is shifted down some bytes, then P will no longer point to the correct location!

So here are proposed ideas on my part:
1) Make a "Relative Pointer Mode" that will use Goto , Return, Lbl , Func, and prgm, based on relative addressing. (This means that it won't matter where in memory the program is because these will all work as offsets from teh start of the program).
2) Add a ' modifier to the commands to tell it to use relative addressing. So Lbl '"Hello will find the offset into the program that the label .Hello is at. Then prgm' will call the offset into the program.

So technical stuff aside, here is the download, currently.

the circle command in this version will let you use an optional argument as the byte pattern for drawing >.> I don't know if this will be changed or not, so it is not documented. So don't use it in a game!
Title: Re: Grammer 2-The APP
Post by: Sorunome on November 21, 2011, 11:01:05 am
Nice! Feature requests:
1) Fix the For( error :P
2) Make it possible to draw lines out of the screen, so it influences what pixel test returns outside of the screen
3) Make that if you have e.g. a rectangle drawn to the half outside the screen and to the half inside that it still draws everything that inside the screen

Oh, and downloaded grammer! ;)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 21, 2011, 01:00:28 pm
I am actually still not sure what the error is D:
Lines can be drawn off screen
I forgot to add that Fix 16 would set the mode so that pxl-Text( returns 1 if it is outside the screen.
The rectangle command... I will see if I can fix up the clipping :/

EDIT: There was no For( error :P It was just my own coding fault. (I did the math wrong in Grammer code, so it was pixel testing non existent pixels)
Title: Re: Grammer 2-The APP
Post by: mrmprog on November 21, 2011, 03:10:58 pm
If you draw off screen, will a pixel test return correctly?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 21, 2011, 04:35:42 pm
No, it will not because the buffer is only the size of the screen.
Because of this, on screen pixels are either ON or OFF. Off screen they are undefined. Normally, 0 is returned of you pixel test off screen. If you set mode Fix 16, 1 is returned instead.
Title: Re: Grammer 2-The APP
Post by: mrmprog on November 21, 2011, 05:21:11 pm
Can drawing off screen cause a crash?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 21, 2011, 11:49:30 pm
I believe the last case of that being possible has been fixed in the latest version (drawing a sprite to specific coordinates caused it to crash).
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 27, 2011, 05:19:07 pm
Okay folks, as promised (on IRC I believe), I got very little done during my 5 day break. However, what I did manage was to add in a signed division routine that is the same exact speed as the regular division routine for positive values (up to 50 to 71 cycles slower depending on if 1 or both are negative). So for that, I need to figure out what modifier I should add to signify signed versus unsigned division. For now, I am using / (there is a space after the division sign).

The other thing I remember adding was something that I got the drive to do from my best friend from back home-- custom font size. Right now I am making a font and a font editor, but it does work. characters can only be up to 8 pixels wide and 32 pixels tall. The display routine right now wraps the letters the same as before, but they can be drawn to pixel coordinates (and the font can all be varying size).

Also, because I added this command, I made the Output( token grant you the power of using custom fonts :)
Now I need to add font documentation somewhere and create a font editor >.>

Here is a screenie of the text (I only have the numbers and the letters A~J finished) and you can see it is a little slower than the fixed sized font:
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 28, 2011, 11:53:26 pm
Sorry for the triple post, but this is a decent update, I believe :/

So some of the new commands are:
Fix 32
     TextMode. 0 is the default, fixed width font. 1 is the variable width font.

The ' modifier can now be used in the Text( command to display an individual character by number. So to display char 248:
Code: [Select]
Text(0,0,'248

Output( can now be used to change the font as well as set a font (for the duration of the program).

/ can be used for signed division. This is a division sign with a space after it. This is still tentative and may not remain backwards compatible, though, so any other suggestions are welcome.

solve(4,Error# will create an error. This is useful if you have a custom error handler where you want some errors to be handled by the program and others by Grammer.

I should also note that errors now have a Goto option if the program is not archived or protected. In the first Grammer, this was always the case, but since it has become an app, I have only just added the code to do this. It will jump to the offending line as it would in BASIC :)

I'm not really sure what other screenies to add, so I will just use one with the incomplete fontset (complete enough for most text).

See this Font Editor (http://ourl.ca/14289.new#new), too!
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on November 29, 2011, 02:15:15 am
Very cool, I like that you can do custom fonts with this now too! =)
Title: Re: Grammer 2-The APP
Post by: DJ Omnimaga on November 29, 2011, 02:37:41 am
Awesome updates Xeda and I'm happy this finally got a sub-forum. Congrats! It deserved it! :)

(I was planning to make a sub-forum when I was still admin, but then Grammer 1 got released and I didn't know a 2nd one would be made)
Title: Re: Grammer 2-The APP
Post by: Yeong on November 29, 2011, 08:10:46 am
Feature request: custom errors? :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 29, 2011, 08:49:25 am
Thanks, guys :)
@Yeong: If I make a custom error, I believe it cannot have a Goto option, but I can add it :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on November 29, 2011, 10:29:17 am
Cool! Updates!/me downloads
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 29, 2011, 08:53:04 pm
So after many requests to add a sound routine and a request to add a custom error, I have finally added them  :w00t:

For now, the sound routine may change unless I get approval from yeong and no better ideas are brought forth, but have fun with the examples. Unfortunately, I cannot take a screenshot of sound with the technology I have here, so you will either need to take my word or try it yourself (I suggest using Wabbit and enabling sound, though it sounds the same on a calc if you have headphones).

So the syntax:
conj(Duration,DataLoc,DataSize
This will play the sound for the data at DataLoc. DataSize is the number of bytes to play. Duration is how long to play each note (256 is fast, 65535 is really slow)

Alternatively, you can play just one sound using the ' operator followed by a note value. The notes are 1 to 127 and 129-255 are silence:
conj(Duration,'Value

And for custom error messages, just add another argument to the CallError command and use error code 2:
Code: [Select]
solve(4,2,"Something
Also, I was wrong before, I did manage to get the Goto option to work, too :
Title: Re: Grammer 2-The APP
Post by: Yeong on November 29, 2011, 08:53:36 pm
oh right!
first download!
now let's mess with sound XD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 29, 2011, 08:54:30 pm
hehe, have fun! I hope you can figure out what I did there .__. Feel free to ask questions :)
Title: Re: Grammer 2-The APP
Post by: Yeong on November 30, 2011, 07:09:49 am
I will say that Grammer's sound routine is kinda....limited compared to axe sound routine D:

Well, this could be kinda off tune, but here's the value for C3(Min)~C6(Max) if anyone is interested.

380→C3
372→C#3
364→D3
359→D#3
354→E3
348→F3
342→F#3
337→G3
332→G#3
328→A3
324→A#3
320→B3

316→C4
312→C#4
309→D4
307→D#4
304→E4
301→F4
298→F#4
296→G4
294→G#4
292→A4
290→A#4
288→B4

286→C5
284→C#5
283→D5
282→D#5
280→E5
278→F5
276→F#5
275→G5
274→G#5
273→A5
272→A#5
271→B5

270→C6

Also, you can subtract all these number by 255 and get the same results (saving space, too ;) )
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 30, 2011, 10:15:19 am
Ah, okay, I was wondering why you were using numbers above 255 XD
Are you taking advantage of the duration, too? Because that gives you some pretty nice control (in my opinion).

EDIT: Also,  :thumbsup: That is very useful :) Did you come by these values through trial and error or did you use some kind of math?
Title: Re: Grammer 2-The APP
Post by: Yeong on November 30, 2011, 11:25:32 am
trial and error XD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 30, 2011, 03:31:59 pm
Ah XD Well I currently trying to integrate the Axe version as an alternative so that I can see what the difference is. I need to figure out all the inputs .__.
Title: Re: Grammer 2-The APP
Post by: Deep Toaster on December 02, 2011, 09:46:34 pm
Whoa custom fonts O.O Sweet language there :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 02, 2011, 10:15:13 pm
Haha, I plan to add parser hooks, too, and you can make a custom error handler (in Grammer code), too >:D That can really come in handy when you don't want certain errors to exit the program.
Title: Re: Grammer 2-The APP
Post by: Deep Toaster on December 02, 2011, 10:15:58 pm
Like try/catch statements? Sounds useful :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 02, 2011, 10:19:58 pm
Well actually, when an error occurs, code can be redirected to an error handler. If the error handler tells it to call a Grammer error or exit, it will, but otherwise you can send it back to the code (and Ans and whatnot are restored properly).
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 11, 2011, 12:15:32 am
So not much of an update, but I added inString( as a command. The arguments are:
inString(Offset,SearchStart,SearchString
I don't think the first argument is really needed so I might remove it before the next update. The outputs have theta prime containing the size of the search string and Ans has the location of the first match (or 0 if there is no match).

okay, back to studying for finals/sleeping/programming
Title: Re: Grammer 2-The APP
Post by: Yeong on December 12, 2011, 07:39:40 am
erm why do I see LD in the program? O.O
Title: Re: Grammer 2-The APP
Post by: aeTIos on December 12, 2011, 07:40:27 am
comment I guess?
Title: Re: Grammer 2-The APP
Post by: Sorunome on December 12, 2011, 09:28:09 am
no, comments are two slashes at the beginning of the line.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 12, 2011, 09:57:50 am
fwahahaha >:D I was showing off the fact that using this command, you can make a compiler in Grammer code :devil:
Title: Re: Grammer 2-The APP
Post by: Yeong on December 12, 2011, 11:15:18 am
O.O
I'm confused now XP
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 12, 2011, 12:23:23 pm
Oh, the LD was just purely data. I used the inString( command to search the data for a match. So if you abuse this, you could make a compiler! :D
Title: Re: Grammer 2-The APP
Post by: Yeong on December 12, 2011, 07:33:24 pm
ah. XP
I was scared for a second that now Grammer's AI had advanced enough that it can compile its own code now :P
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 14, 2011, 08:42:06 am
I am not sure if I mentioned this, but I have also added the length( command by request (it was a nice idea). It can do two things:
length(<<varname>> will return the size of a variable (archived or RAM) and it returns the pointer to the data in theta prime
length('DataStart,Size,LineNumber[,linebyte
This will let you read lines in a program for example. So if A was the pointer to the program and you wanted to read  line 7:
Code: [Select]
length('A,0,7
The default linebyte is 63 (the byte the OS uses for BASIC programs for a newline). The optional argument lets you read data that has a different byte separating them. For example, if you have a space between words and you want to read each word, then you can use 41 as the line byte.

Also, in the above code, I use 0 as the size because that is translated to 65536. If you were to use the size of the program, the search would be limited to the program.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 24, 2011, 04:40:52 pm
I am not finished updating, but it has been a while since the last update so here goes. Since the last version, I have added:
     length(<<varname>>
     length('DataStart,Size,LineNumber[,linebyte
     inString(Offset,SearchStart,SearchString
     conj(Duration,'Value
     conj(Duration,DataLoc,DataSize
     conj('Time,'Freq Uses the Axe sound routine.
     conj('Time,DataLoc,Size Uses the Axe sound routine but it reads data directly to save time (intead of converting numbers on the fly). Size is the size of the data in words, not bytes.


Some stuff that I haven't mentioned in previous posts:
     >Frac is used to factor and test for primality. Its outputs are the smallest factor in Ɵ' and the result of Ans divided by that in Ans. So for example, if the output Ɵ' is 1, that means the number is prime. If you did this:
Code: [Select]
221>Frac
Ans would be 17 and Ɵ' would be 13.

I have also added support for running assembly programs with Grammer. So if you want to run an assembly program from the homescreen without Asm( in front of it, you can. Plus, if you do it that way, you can run it from Archive, too. On top of that, I decided to detect ION, MirageOS, and DoorsCS programs. If you try to run those, you will get a custom error message.
The real use, though, is that Assembly programmers can now build assembly programs using a special Grammer header and they can use the calls from Grammer. Unfortunately, while there are over 100 available calls, I have only had time to document about half of them.

So I hope y'all enjoy the new stuff, I hope you make new proggies, and I will see if I can get any useful assembly programs going. I won't have internet for a little while, so I may not be able to respond immediately, but feel free to ask questions.

I feel like I missed something other than the gravity engine buried somewhere in the program...
Title: Re: Grammer 2-The APP
Post by: Sorunome on December 24, 2011, 05:35:04 pm
*yay* updates!
/me downloaded
Title: Re: Grammer 2-The APP
Post by: Yeong on December 26, 2011, 04:30:47 pm
/me downloads as well
Title: Re: Grammer 2-The APP
Post by: Sorunome on December 26, 2011, 04:32:16 pm
/me just noticed that he forgot to load that on his calc! D:
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 28, 2011, 07:52:57 pm
Okay, so three things:
1) I forgot to mention that I added the commands and , or , xor , and not(. These just perform the basic bit logic operations. For example, 5 and 6 will return 4
2) I added a new particle command that will allow you to convert a rectangular region of the screen to particles.
     P▶Rx('Y,X,Height,Width
3) I have a new update that I am sure will be loved, but may cause yeong and Sorunome to go back and add in some more delays to their programs. Maybe.

Pretty much, I have been working for the past 2 days rewriting the parser and it was worth it. I made the number converting routine about 2.5 times faster for starters and I decided to use a lookup table to jump to commands more quickly. The net effect? Some programs run as much as 8 times faster. Don't believe it? I admit that most programs won't get that kind of a speed boost, but algorithms definitely get a huge speed boost. Pretty much, everything except DispGraph and Pause have been affected (and even those get about a 500 cycle speed boost).

So what kind of a speed boost should you expect? Well, the games that I have toyed with work in 6MHz at the speed you would expect out of 15MHz, so they work about 2 to 3 times faster. I think Tetris didn't get too much of a speed boost, though.

[offtopic]
5 or 6   = 7
5 and 6 = 4
5 xor 6  = 3
 uses 3,4,5,6,7
[/offtopic]
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on December 28, 2011, 09:20:44 pm
Wow, nicely done! =)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 29, 2011, 12:31:15 am
Thanks :) Also, I would like to note that I am debating on adding a 32-bit mode. It is unlikely, but I already have the math routines coded for most of it (adition, subtraction, multiplication, division).

Oh, and I mentioned that new particle command? Here is a screenie :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on December 29, 2011, 10:00:41 am
That is incredible fast!/me has to rewrite grammer tetris for optimizing with better delays....
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 29, 2011, 10:01:27 am
Hehe, and maybe a new level of difficulty...?
Title: Re: Grammer 2-The APP
Post by: Sorunome on December 29, 2011, 10:39:27 am
yeah, and first of all fix some bugs, e.g. the figure falls more slowly when you hold down any key.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 29, 2011, 10:48:01 am
Yeah, I tried fixing that myself when you let me optimise it, but I couldn't figure out a good way to do that :/

Actually, I have an idea: Have it so that in the Repeat loop, when you press down it sets the timer to the maximum. (or is it 0?)
Title: Re: Grammer 2-The APP
Post by: Yeong on December 29, 2011, 12:23:00 pm
I don't know if this is bug or not, but just leave it if it is because it's really cool. :D

prgmA0
Code: [Select]
.0:
.A
ClrDraw
Text(0,0,"HI
DispGraph
End
Stop

prgmA1
Code: [Select]
.0:
solve(0,"EA0","VTEMP
prgmLbl "A
Stop

Archive A0 and run A1, and it works.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 29, 2011, 01:46:05 pm
Erm, that is not intentional in the least and I believe what it is doing is finding the RAM of the program (it isn't erased when archived).
Title: Re: Grammer 2-The APP
Post by: Yeong on December 29, 2011, 01:53:49 pm
Erm, that is not intentional in the least and I believe what it is doing is finding the RAM of the program (it isn't erased when archived).
I actually got the idea(code) when I found out that when I forget to put "Stop" on Grammer program, it just "jumps" to next program in line. :P
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 29, 2011, 07:52:06 pm
:P
In any event, the safest way is just to do the code I showed. You can do some really neat things, though, like jumping to labels in other programs.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on December 31, 2011, 10:25:11 pm
In response to continued requests, I have a mini update that has full clipping for rectangles. I hope it works the way you would like it to!
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 07, 2012, 09:55:42 am
/me downloads :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 07, 2012, 11:22:00 am
.___. I will say that there are two bugs that I have found and fixed so far for the next update. abs( does not work for negative numbers and in the feature requests thing, the very newest version messes up with solve(0 if the optional arguments aren't used. Well, I will upload that now as a mini update, I guess.

Also, here a screenie of an attempt with grayscale tilemapping
(http://img.removedfromgame.com/imgs/GrayMap0.gif)

I still need to work on it because there is still some flicker on my actual calc. I am going to experiment with what I have learned from folks like Runer :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 07, 2012, 11:35:35 am
/me had to program a routine that made the same as abs
oh, and downloaded! xD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 12, 2012, 11:37:32 am
Okay, so here is an update :) I cannot remember everything that I have added or fixed, so sorry :/ What I do remember:
Vertical has been fixed. Apparently it is so unused, nobody found that it wasn't working for probably a month or two XD
Pt-On( and Pt-Change have two more tile drawing methods. Method 6 is now Mask and Method 7 is now Gray. The way the sprite data is setup is like this:
First byte is the first drawn layer and the second byte is the second drawn layer.

For Masked sprites, the first layer is the mask. For the mask, leave pixels off where you want the screen erased. The second layer is drawn over top with OR logic.

For Gray sprites, the first layer is the gray layer. Leave pixels on for gray, off for white. The second layer is the black layer. Leave pixels on for black and off for white. So if a pixel is on in the black layer, it will be black. If it is off in both layers, it will be white. If it is on in only the gray layer, it will be gray.

For gray sprites, you will constantly need to redraw it and display the screen to get the effect (otherwise, you will notice the sudden freeze in gray on whatever frame it is on).

As another note, the screenie is about what you should get on your calc (it is what I get).
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 12, 2012, 12:04:08 pm
/me is the first one to download
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 13, 2012, 07:37:11 am
Okay, I am still trying to think of how best to do this, but I have started to make a token hook. The token hook simply changes the names of a few OS tokens while editing a Grammer program. If the program you are editing starts with .0:, the token hook will take hold. This also happens if you put that header on the homescreen >.>

If anybody wants to play with this experimental version, feel free.
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 13, 2012, 09:47:31 am
/me downlaods.
Now I have to get used to new tolkens xD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 13, 2012, 09:49:14 am
This is only experimental and I am not sure if I will keep them or not. Do you think I should?
Title: Re: Grammer 2-The APP
Post by: imo_inx on January 13, 2012, 09:49:17 am
*iMo downloads
YES!!!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 13, 2012, 09:50:36 am
Cool, a new Grammer coder! Have you gotten to practice with it yet?
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 13, 2012, 04:40:24 pm
This is only experimental and I am not sure if I will keep them or not. Do you think I should?
The problem is: They don't seem to work with zstart so I didn't test it yet
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 13, 2012, 05:45:32 pm
The token hook or Grammer itself doesn't work with zStart?
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 14, 2012, 04:32:55 am
I don't know now if i have the correct grammer version, as it also doesn't work without zstart....you really should make it somewhere display the current version.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 14, 2012, 10:26:19 am
Hmm, well it did work for me... And I will try to add code so you can see the version (it won't be difficult).

You will need to be editing a program that starts with .0: in order for the tokens to change. On the homescreen or in a regular program, the tokens are not changed.
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 14, 2012, 11:50:18 am
Now the tolkens are working! I just didn't had the newest grammer version :P
That's cool! I like it with the other tolkens.
But unfortunatly it doesn't work far to good with zstart, as they are killed (the hooks) everytime you press on+clear... :(
Title: Re: Grammer 2-The APP
Post by: Spyro543 on January 14, 2012, 02:05:14 pm
*iMo downloads
YES!!!
Um, you have a Casio calc, or did you happen to purchase a TI-8x plus without me knowing? :P
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 14, 2012, 05:53:34 pm
But unfortunatly it doesn't work far to good with zstart, as they are killed (the hooks) everytime you press on+clear... :(
Ah, I didn't expect that to work :/ I can try to see if I can get token hooks to work with other apps, but that might cause some lag with tokens.

@iVenom: Wait, do you have some kind of emulator?
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 15, 2012, 02:45:18 am
But unfortunatly it doesn't work far to good with zstart, as they are killed (the hooks) everytime you press on+clear... :(
Ah, I didn't expect that to work :/ I can try to see if I can get token hooks to work with other apps, but that might cause some lag with tokens.


Or maybe you should just get penguin into making zstart compatible with grammer :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 15, 2012, 09:23:02 am
I finally PMed him XD He was waiting for me to PM him so that he knew where to make calls where the parser started and whatnot.
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 15, 2012, 11:49:30 am
Cool!/me waits for new zstart version
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 16, 2012, 10:08:19 pm
I put together a Grammer "tribute" thing earlier today. I probably won't be able to program much for a while, so here you guys go! I hope Grammer will hold you over until I get more time to work on it :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 17, 2012, 12:47:38 pm
The ReadW( token must be ReadW{ With curly brackets, as it also requires a curly closing bracket.
/me downloads grammer version
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 17, 2012, 01:59:02 pm
Actually, it doesn't use ending brackets o.o the following do nothing in Grammer (literally, they point to an RET when executed):
)}]
There are a bunch of other tokens, too, but I cannot list them all XD

That is also why the For( token has the '(' changed to a space (like on the TI-89). I am still thinking of removing the token hook (or just making it an option).
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 17, 2012, 03:02:45 pm
I'd do second thing.
And I understand why you don't need need the curly brackets :)
And I would recommend to add version number being displayed :P
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 17, 2012, 03:07:46 pm
Okay, I am preparing for an update to TICalc.org, so I will add that in when I rewrite the menu XD

EDIT: Okay, does this work?
(http://www.omnimaga.org/index.php?action=dlattach;topic=12061.0;attach=11291;image)

EDIT2: This section stems from the feature requests thread after adding in some requests such as:
When using [ to store data to a location in RAM, you can now use º after a value to store it as a two-byte, little endian value. This wonderfully useful feature is a request from Yeong and it is one that I will love as a Grammer coder.
Also if you use [[ instead, all values will be stored as two-byte values in little endian style
Even more is that using [( will let you store a string of hexadecimal digits. If an odd number of digits is sent, a padding "0" will be tacked on to the end.
Finally for this command, the output now points to the data directly following.
Before I get to the next part, here are some examples:
Code: [Select]
A[0,0,1,2,3     ;this writes the bytes to A as normal
A[0,1,-1º,2,3   ;this stores the bytes to A, but -1 is stored as two bytes
A[[0,1,2,3      ;the bytes are stored as two bytes (little endian)
A[(EEFF0011     ;the hex is converted and stored (good for data)
A[5,6
[2,3            ;these are output directly after the 5 and 6

Indeed, there is a "next part." Users can now access var such as Strings and GDBs in a new way. by adding numbers to the end of the name, you can access, say, Str133. To access this, use the Str1 token followed by 33. This gives you access to Str1 to Str256 and likewise you can access GDBs, Pics, and other such OS vars. Note that Str10 and Str0 are the same thing, but Str0 is 1 byte smaller in a source.

A new feature is what actually motivated me to add that last one. OS strings can now be stored to with 2 options. By adding a ' at the end of the string name, an extra newline token will be added to the end. This is needed if you want to be able to read or use it as a Grammer string as Grammer strings use terminating bytes rather than a given size, like the OS.

So some examples of valid syntax include:
Code: [Select]
"Hello→Str33'
Text(0,0,Str33
A→Str213

I hope y'all have fun with the features!
Title: Re: Grammer 2-The APP
Post by: Sorunome on January 18, 2012, 09:21:45 am
Cool!/me downloads!

I got a question to that stringy, would then also Str000 work?
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on January 18, 2012, 10:10:23 am
Nice to see a new version. By the way, is there a readme floating about somewhere?

*edit* Speeling Fale x.x
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 18, 2012, 11:46:56 am
@Sorunome: Grammer will see that as Str1000, but only the LSB is used. so in hex, 1000=3E8h, so it uses E8h which is 232 in decimal. So Str000 is the same as Str232
@Art_of_camelot: I am working on an up to date readme, but what I have so far is included in this post.

@Alll: If anybody has a better way to organise the readme and make it more understandable, feel free to give ideas!


@Yeong: I remembered to save the list of Prefix bytes for different variable types, this time :)
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on January 18, 2012, 08:59:50 pm
Ok, thanks! =)/me is gonna start tinkering with Grammar. :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 18, 2012, 09:07:11 pm
Cool!
@Anybody that wants it:
The Grammer Feature Requests page currently has a version with the ln( command that lets you jump forward or backwards a given number of lines.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 29, 2012, 10:37:59 am
Okay, news, good news and better news:
1) I started freeing up saveSScreen so that eventually folks can use that a an extra screen buffer. It is not used yet, but it will be eventually. This also limits label names to 10 bytes (actually, probably 30 ish)
2) I added an optional argument for Lbl that will let you search a label in a specific program. For example, Lbl "HELLO","EHI will search for the label HELLO in program HI.
3) I just started going through and removing unused code and I am surprised I was not assassinated by the programming gods o.o I cut out over 3000 bytes of code, so Grammer has over 6000 bytes of space left. Now I want to see what I can do about trig LUTs and whatnot...
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 02, 2012, 11:41:31 pm
Okay folks, I fixed up the line routine which has been a little buggy and I also modified the sine and cosine routine to be faster and more accurate. if you want it, I think it is a useful update :) also, I made this proggie (see the screenie).

EDIT: An added stat: The sine and cosine routines are twice as fast and it only used a few extra bytes :) It is about 3 times as fast as the original routine x.x

Title: Re: Grammer 2-The APP
Post by: Sorunome on February 03, 2012, 04:26:55 pm
That is looking cool! Great work! :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 03, 2012, 05:26:41 pm
I wish I was good with 3D stuff D: Somebody on TIBD had a great idea... That flingfisch might be interested in >:D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 06, 2012, 04:43:02 pm
Okay, here is the next update :) There are a few new commands and updates including the ability for Text( to display 32-bit numbers, a token for binary input, and even better, conj( has finally been set in stone with this update. The syntax for conj( is:
conj(Note,Octave,Duration
Note is 0 to 11
Octave is 0 to 6
Duration is the number of 64th times to play. so to do a quarter note, use 16 (16/64 = 1/4)

With this, I have made a music player in Grammer that should be ready for a first release soon :)

Hopefully I didn't upload wrong files again >.>
Title: Re: Grammer 2-The APP
Post by: Yeong on February 06, 2012, 05:53:07 pm
I'm glad that MuseInc helped you through it. :)/me downloads
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 06, 2012, 07:13:09 pm
Yes, thank you much :D
Title: Re: Grammer 2-The APP
Post by: Sorunome on February 07, 2012, 10:02:24 am
You could change that tolken via your token hook to music( :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 07, 2012, 02:17:30 pm
Hmm, maybe Note( since the commands really play a note or series of notes?
Title: Re: Grammer 2-The APP
Post by: Yeong on February 16, 2012, 07:53:04 pm
we should have a Grammer Wiki. :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 16, 2012, 08:11:49 pm
O.o I would not know where to begin D:
Title: Re: Grammer 2-The APP
Post by: Yeong on February 16, 2012, 08:36:25 pm
Start with documenting all the commands? :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 16, 2012, 08:39:53 pm
How does a wiki get created? (Also, I am adding the fire routine >.> )

EDIT: Fire is added >.> To use it, use FIll(22,x. If x=0, it uses white fire, 1 uses black fire :D
Title: Re: Grammer 2-The APP
Post by: Yeong on February 16, 2012, 09:21:21 pm
now can you add the optional argument for setting a specific region?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 16, 2012, 09:23:36 pm
That might take a bit more work, but it should be worth it. Maybe Fill(23... And should it be arbitrary pixel coordinates or can it be aligned (every 8 pixels wide)
Title: Re: Grammer 2-The APP
Post by: Yeong on February 16, 2012, 09:24:35 pm
if you add that, that will be really useful with pyro. :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 16, 2012, 09:30:08 pm
If I have it based on 12 columns on the screen, then it should be able to be done quickly, but if it is based on pixel coordinate boundaries, it will be quite a bit slower. :/
Title: Re: Grammer 2-The APP
Post by: Yeong on February 16, 2012, 09:30:30 pm
12 columns sounds good to me. :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 16, 2012, 09:33:10 pm
Cool, so to be clear, it will be like if you have it at X offset 3, it will be at 24 pixels from the left. If it is 3 wide, it will be 24 pixels wide. Height will be based on pixels, though.
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on February 17, 2012, 05:45:25 am
Hehe, that fire really is awesome! :D
Title: Re: Grammer 2-The APP
Post by: turiqwalrus on February 17, 2012, 07:00:00 am
I found a minor typo in the commands list >.>
Quote
!Repeat checks if the statement is false in order to end. For example,
to remain in the loop while Enter is being pressed:
:!Repeat getkey=15
:End
it should be clear :P
I really like grammer, though :D
I just tested it out...
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 17, 2012, 07:20:15 am
Awesome, and thanks :D I've no clue how I could make such a mistake O.O But I'm glad you are trying it out! :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 19, 2012, 10:09:59 am
Okay, here is that other Fire command. This is Fill(23 and it has this syntax:
Fill(23,Type,Y,X,Width,Height
After the 23, the arguments are like Pt-On(, except Type comes in two kinds, black fire or white fire. 0 is white, 1 is black :)
Title: Re: Grammer 2-The APP
Post by: Yeong on February 19, 2012, 10:38:50 am
yay./me downloads
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 19, 2012, 12:53:16 pm
It will be cool to see what you can do with this O.O I was trying to see if I could make a burning sprite, but I've had no luck :/
Title: Re: Grammer 2-The APP
Post by: turiqwalrus on February 20, 2012, 02:28:50 am
will download as soon as I can pester my brother to let me use his laptop for a sec :P
Title: Re: Grammer 2-The APP
Post by: Yeong on February 20, 2012, 07:03:24 pm
happy to see another Grammer coder. :D
Title: Re: Grammer 2-The APP
Post by: nxtboy III on February 20, 2012, 07:53:15 pm
BTW, how is the fire made? Psuedo code?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 20, 2012, 09:01:08 pm
Pretty much, the pixel is shifted up one and it has a 1/x chance of dying. In Grammer, for now, that chance is about 1/8 (I might add options for 1/4 for smaller flames and 1/16 for larger flames).
Title: Re: Grammer 2-The APP
Post by: Happybobjr on February 20, 2012, 09:56:23 pm
I don't want to read 16 pages, but i guess i must :P
Title: Re: Grammer 2-The APP
Post by: nxtboy III on February 21, 2012, 08:01:35 pm
Thanks for the pseudo, Xeda! I guess it's really quite simple. :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 21, 2012, 08:23:28 pm
Yeah, it is crazy O.O If you want to apply this to a system with more colors, instead of dying, you can make it fade one more color to really give it a fire effect! I really think it would be cool to make a grayscale fire routine, but that would work much easier going from white fire to gray, to black. Also, I just realised how I can easily add in better grayscale support (such as drawing as white, black, or gray).

What I would do is since you use Disp to define the current draw buffer, you could use Disp ' to define the gray buffer. Also, I might experiment with some behind the scenes stuff to make updating the screen even faster.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 22, 2012, 08:06:07 am
I rewrote the DispGraph routine and it now updates a little faster. Even better is that it automatically updates with grayscale! The only thing is, you won't get to use it or see it because for now, the gray buffer and black buffer are the same buffer. So how do you change this?

Use Disp ' to change the black buffer. Not changing the gray buffer will leave the gray buffer on the graph screen.
Use Disp o to change the gray buffer.
Use Disp to set both the gray and black buffer to the same thing.

I still need to change the drawing commands to accept an extra argument or modifier to draw as black/white/gray.

EDIT: I am going to wait to release it, but I have drawing rectangles to specific buffers and clearing specific buffers (like the gray buffer or black buffer) working. I am waiting until I have this available for all the other drawing commands. Meanwhile, check out the grayscale cursor thing I made :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 24, 2012, 10:21:03 am
Okay, here is an updated version, now fully ready for grayscale drawing! You can now add an argument to most drawing commands to draw to a specific buffer (it doesn't even need to be the gray buffer or black buffer). Some command to do this with:
Pt-On( to draw a tile
Pt-Off( to draw a sprite
Horizontal
Vertical
Pxl-On(
Pxl-Off(
Pxl-Change(
Pxl-Test(
Line(
Line('
ClrDraw
Circle(
I have written a few programs using these, but nothing too major yet. I can't wait to see what gets done with this o.o Also, you might be surprised to know that Circle( actually had another optional argument that looks like it is going to stay, so don't forget that argument when drawing circles to arbitrary buffers! (the argument lets you draw dotted circles and whatnot)

So I updated the readme, added another .txt document for grayscale info, and did some other miscellaneous house keeping. Enjoy!
EDIT: Added another screenie an example. For prgmGRVTYFUN, use the arrows to change the gravity, use + or - to add or delete objects, press clear to exit :)
Title: Re: Grammer 2-The APP
Post by: DJ Omnimaga on February 24, 2012, 11:00:56 am
Woah that's really cool that you have stuff moving so fast with physics O.O. On top of that with grayscale. :O

So now I guess Grammer can definitively be used for games like Desolate too :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 24, 2012, 11:03:43 am
O.O I don't know about that, but I hope some really cool stuff comes of this! I also plan to add grayscale fire *cough* and maybe if I rewrite the particle system, I can have multiple particle types and colors in a buffer I think it would be lovely and neat...
Title: Re: Grammer 2-The APP
Post by: Jonius7 on February 26, 2012, 07:52:29 am
Great app. I just got confused where the latest version was. It wasn't on the first post I think. I had to look at your signature to download it. But anyway, great job, keep up the mammoth effort!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 26, 2012, 10:26:45 am
Crap, I need to update my signature and first post .___. The latest is a few posts ago: http://ourl.ca/13558/286889
EDIT: Eh, never mind, here is a minor update that fixes a bug in pixel testing (when you use Fix 16, I forgot I broke it) and I found out that I forgot to update augment( to work with my other changes, so now it works :)
Title: Re: Grammer 2-The APP
Post by: Jonius7 on February 26, 2012, 03:54:02 pm
Good job Xeda! Grammer shall now be greatly accessible to everyone!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 26, 2012, 03:57:04 pm
:D I also took the advice of kindermoumoute and made a topic like Axe's for just updates :)
http://ourl.ca/15327
Title: Re: Grammer 2-The APP
Post by: Jonius7 on February 26, 2012, 03:57:36 pm
Yes I have seen that. It's good that it has that, now that Grammer is becoming so major. I shall try your block eater asap!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 26, 2012, 04:01:01 pm
Awesome, I hope you enjoy it :D I already have added an enemy that chases you o.o
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 29, 2012, 09:41:45 pm
This is kind of a prerelease that includes the still faulty pxl-Test( change. It will be a while before I can get back to work on it, so I will give these tips:
It currently does not properly pixel-test regions one pixel wide.
It automatically quits if it is out of bounds on the left and top (otherwises, it resizes the region which will not happen in the final version).

So to use it, pxl-Test('X,Y,H,W,0 (that is a zero). It will return the number of set pixels on the perimeter. This is also so that I can release my Gravity Jump program ^_^

(It also can have an optional argument for the buffer to test on)
Title: Re: Grammer 2-The APP
Post by: Yeong on February 29, 2012, 09:55:15 pm
where does H and W start from?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 29, 2012, 10:01:46 pm
Height and width start at 1 and go to 96 and 64, respectively, sorry.
Title: Re: Grammer 2-The APP
Post by: Yeong on February 29, 2012, 10:03:33 pm
oh. I was thinking that it was based on sprites... XD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 29, 2012, 10:05:08 pm
No, the arguments are pretty much the same as the Line( command. I was originally going to add this as a rectangle option, actually.
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 01, 2012, 09:36:45 pm
Kind of a random question, but in a grayscale grammer game would you use Pxl-Test for collisions?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 01, 2012, 10:08:50 pm
You can do that and the pixel test command will let you check the buffers. For example, you can make your sprite on the black layer detect only collision on the gray layer (so it can go through anything else on the black layer). I made a program earlier that had fire on the gray as the "background" while a box bounced around the screen (also leaving a trail of fire on the gray layer). I added some code so that I could stop the fire and bouncing to watch the gray fire XD

Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 01, 2012, 10:11:54 pm
Oh, cool! So using another buffer is the only way?
Is that how a grammer platformer would work?

EDIT: Sorry I'm such a newbie, but can Grammer have multiple threads/tasks?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 01, 2012, 10:18:33 pm
Kind of, but things like interrupts still need work and are buggy. Still, you can program it to perform several tasks, but I have made plans in the past to add multiple threading officially :)

As a platformer example, take a look at this that I posted yesterday (also in grayscale with collision detection):
http://ourl.ca/15386
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 01, 2012, 10:44:03 pm
Is there a way to have a game where the colliders (platforms) are gray?
Title: Re: Grammer 2-The APP
Post by: Yeong on March 01, 2012, 10:44:40 pm
pxl test during Disp' ?
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 01, 2012, 10:47:12 pm
???
I'm super new, so I am confused... sorry. what is the ' for?
Title: Re: Grammer 2-The APP
Post by: Yeong on March 01, 2012, 10:48:32 pm
nvm.
Disp' sets the buffer for grey part of the screen, iirc.
so after that, do Disp whatever and pxl test.
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 01, 2012, 10:51:19 pm
Yeah.... But gray (50% gray) is a checkerboard design, so wouldn't it half the time see pixels as off because half the time they are off?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 01, 2012, 11:23:43 pm
Better idea:
You will have a pointer to the gray layer (you have to define it anyways). The buffer will not change, regardless of the checkerpattern (that is only factored in when actually displaying). So if Z points to the gray buffer, you can do this:
pxl-Test(Y,X,Z

The extra argument "Z" makes it read from the buffer at Z instead of the black buffer. Does this help any?
Title: Re: Grammer 2-The APP
Post by: awalden0808 on March 02, 2012, 07:15:22 am
Soooo, nxtboy. The "Mindstorms Nxt" in your sig... LEGO Mindstorms? The thing I've wanted since I was in 2nd grade (9 years, for the record)? That one? The one I'm super jealous about? That one? :P
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on March 02, 2012, 07:31:34 am
@alwalden0800:Please try to remain on topic. We do have a private messaging system for such things. There are a also a few topics about the Mindstorm floating around on our forums that you can post relevant discussion in. :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 02, 2012, 02:01:10 pm
I completely forgot to give a heads up, but I have spring break starting about a half hour ago. My internet access will be a bit limited, so updates will not be here for a little while. Maybe I might get some more cool stuff done XD Then again, I have a few tons of homework to muddle through :/
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 02, 2012, 05:55:16 pm
OT:

awalden- Yes, the Lego Mindstorms NXT :P
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 03, 2012, 11:46:16 am
About the platformer games....
Doesn't that mean that you can only have 2 types of blocks, solid and not solid? There cannot be blocks that kill you, blocks that are breakable, etc.?
Title: Re: Grammer 2-The APP
Post by: Yeong on March 03, 2012, 11:48:53 am
Actually, that's up to your programming. ;)
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 03, 2012, 11:50:16 am
Yes... But how would that be done?

EDIT: Because since it uses pxl-test it can only check if a pixel is black/white.
Title: Re: Grammer 2-The APP
Post by: Yeong on March 03, 2012, 11:52:07 am
What I did before is that display tilemap, and get the tile number based on the coordinate. If that tile number matches certain number, you die or something.
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 03, 2012, 11:53:01 am
So is it impossible using pxl-test and not a tilemap? How would it be done?
Title: Re: Grammer 2-The APP
Post by: Yeong on March 03, 2012, 11:56:50 am
you can mix with the pxl-test if you want to.
Let's say you have a appvar with tilemap stuffs.

So you can do X/8 and Y/8 (x and y being coordinate) to get which tile goes where. And you can do a little math to figure out the location of the appvar (aka tile number).
And you can test with both pxl-test and tilemap number.
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 03, 2012, 11:58:23 am
Yes... But what if you wanted to make the tiles not tiles, but pixel-by-pixel?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 03, 2012, 02:46:32 pm
It would take a lot more memory, but if you wanted it to still be speedy, too, you could make several buffers containing the data in layers. For example, 3 buffers could make each pixel in 8 different states. To better save on memory, you could store the location of a few pixels and what they do in memory and just check to see if the region does anything. You could still use tilemaps and not the command. For example, I made a maze like program that used 6x6 tiles and a buffer that contained the values for those regions. The program would manually draw the stuff, but it was easy to see if you were on a warping tile or a tile that would kill the player or whatnot.
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 12, 2012, 03:39:07 pm
Just wondering, exactly how long does it take to use pxl-test in Grammer?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 12, 2012, 04:02:16 pm
I just ran this code and it took 8 seconds to pixel test 10 000 times:
Code: [Select]
0→X→Y
For(A,0,9999
pxl-Test(X,Y
End
Stop
That was in 6MHz, too :D

EDIT:40 seconds to do 60 000, so about 1500 pxl-tests per second
Title: Re: Grammer 2-The APP
Post by: turiqwalrus on March 12, 2012, 04:05:07 pm
I just ran this code and it took 8 seconds to pixel test 10 000 times:
Code: [Select]
0→X→Y
For(A,0,9999
pxl-Test(X,Y
End
Stop
That was in 6MHz, too :D
therefore about 5 seconds to check the entire contents of the screen(not as if that's actually needed)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 12, 2012, 04:10:53 pm
I just tested on my real calc and all the pixel commands are that fast O.O
EDIT:
it takes about 4 seconds to fill the whole graph screen using Pxl-On( which is 6144 pixels (also at 6MHz)
Using math is what will slow it down, though D: It takes 7 seconds if I use Pxl-On(X+1,Y+1

And about 10 to 11 seconds when multiplying by 65535 (the slowest multiplication)
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 12, 2012, 04:53:40 pm
Wow, so it takes about 1.25 milliseconds to do pxl-test.
On a similar thing for pxl-test on my NXT, it takes around .48 milliseconds. How fast does it go running at 15 Mhz?

EDIT: On my NXT it takes 1.221 seconds to fill the screen with going just pixel by pixel.

EDIT2: So how does PARTEX2 run so fast with so many particles??
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 12, 2012, 08:20:20 pm
It takes about 1.70 seconds to fill the screen at 15MHz. As for Partex2, I just wrote the code to be fast. It reads the coordinates from an array and pixel tests as needed. To update a particle, it just changes the coordinates and draws accordingly. I am actually going to rewrite it to be faster, hopefully. I made a grayscale version over spring break, but at 2000 particles, it definitely could not do grayscale XD It did not look bad at all, actually, but I still want to see if I can speed up the process :)
Title: Re: Grammer 2-The APP
Post by: Yeong on March 12, 2012, 10:12:50 pm
/me thought new Grammer came out D:
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 12, 2012, 10:38:54 pm
Sorry D: I am trying to think of what I can easily tackle or fix for now :/
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 13, 2012, 07:50:32 am
So it reads from a map and an array? Why not just one?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 13, 2012, 08:27:59 am
I am confused... D: A tilemap is an array...
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 13, 2012, 08:30:03 am
oops....  :banghead: I meant to say that it reads from the screen (pixel data) and an array?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 13, 2012, 08:37:58 am
Oh, for the particles. Yes, it has to read from both so that it can interact with the environment. There is a particle buffer and screen buffer. The particle buffer interacts with the screen buffer :) That is how it flows around static objects :D

EDIT: I refer to the particle array as a particle buffer.
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 13, 2012, 08:47:32 am
So are the particle location's stored in a variable (array of locations)?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 13, 2012, 08:49:36 am
The array is stored elsewhere. As long as you have a pointer to the array, you are fine :) The location is generally a fixed location for the duration of the program, though.
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 13, 2012, 08:55:26 am
???
I'm confused....
So how does it check collision with the particle and a solid pixel? Does it have an array of particle locations??

EDIT: Could you maybe show me some psuedo code for the particle and how it moves?

EDIT2: I made a similar program to partex 2 for my NXT, and it runs slower than on the calc. But doesn't an NXT have a faster processor (or maybe not)? The NXT's processor is newer and is running at 48 Mhz,and is 32-bit.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 13, 2012, 03:03:02 pm
Wow O.O 48Hz is 8 times faster than the calc. Okay, some pseudo code...
Make a finite array of, say, 12 elements. This is the data for 6 particles. The elements are:
{X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6}

So loop through the particles like this:
For the first particle, get (X1,Y1). Test the pixel below that coordinate. If it is empty, do Pxl-Off on the original, Pxl-On to the new location and change Y1. If it is not empty, randomly select left or right to test first. If it is empty, move there, adjusting pixel states and updating X1. If that is not available, check the other left/right and do the same. Finally, if that isn't empty, either, do nothing.

Since the particle should not be starting on any already made pixels, it never occupies an already occupied space and so it does not delete any original contents. It only deletes itself from frame to frame. In BASIC, I did this:

Code: [Select]
{3,3,3,3,3,3→L1    ;Y-coordinates
Ans→L2              ;X-coordinates
Repeat getKey=45
For(A,1,6
L2(A→X
L1(A→Y
If pxl-Test(Ans+1,X
Then                     ;This checks left/right
2randInt(0,1)-1→B   ;B becomes 1 or -1
If pxl-Test(Y,X+B
-B→B
If not(pxl-Test(Y,X+B
Then
Pxl-Off(Y,X
X+B→L2(A
Pxl-On(Y,Ans
End
Else
Y+1→L1(A
Pxl-Off(Y,X
Pxl-On(Ans,X
End
End
End

You will see it doesn't go nearly as fast in BASIC which is why I did it in ASM >.>
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 13, 2012, 03:15:12 pm
Hmm... On my NXT I did something similar and it is slower...
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 13, 2012, 03:17:37 pm
I also wrote the code in assembly and for things like this, the process can be really sped up. I am not sure how other languages compare.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 21, 2012, 10:17:26 am
With very little time to code for Grammer (school and TI-Concours) I don't have much of an update to offer. However, I do these two features for the Text( command that I thought might be useful:

Setting the coordinates:
Text(Y,X with no extra argument will set the coordinate position
Relative coordinates:
Text(+Y,+X,... Grammer now preloads the last text coordinates in Ans before reading the argument. That way, if you want to do something like superscript or subscript, you can do +2 or -2 or something for the Y coordinate. Then directly after, you can set the coordinates again. So as an example:
Code: [Select]
ClrDraw            ;Clears graph screen and sets text coordinates to zero
Text(2,,"ax        ;Displays text at Y=2, leave X unchanged
Text(-2,,"2        ;Draws the 2 as a superscript (though really, you could use 0 instead of -2 in this case)
Text(+2,,"bx+c     ;Draws the rest back down 2 pixels
As a note, that is minus 2, not negative 2. Also, you see the trick that is new for Text( where you have no argument between the commas. That is essentially "+0" and was not a trick previously available.

Anyways, I am wondering if this is okay for folks?

EDIT: Also, read two posts below before downloading this. I plan to have another release later today with a lot more features than this.
Title: Re: Grammer 2-The APP
Post by: nxtboy III on March 21, 2012, 10:24:16 am
Woa, that's cool. That's a good idea! So that could make it easier to make moving text, wouldn't it?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 21, 2012, 10:43:50 am
Hmm, I'm not sure, but it does definitely help text graphics. Pretty much, the Text( command has its own section/chapter thing in the tutorial because it has soooo many things that can be done and so many manipulations.

I am also working on a third font option that will use 4x6 font, but it will draw to pixel coordinates. That way, you can combine the variable size font with the fixed font to get better math looking results. I was also thinking of letting the Text( command with no arguments return the current cursor position. I was thinking also of adding the ability to do something like →AB where B would be loaded with the results of Ans and A would be loaded with Theta'. That way, you could do Text(→XY to get the X and Y coordinates in X and Y and also get overflows into other vars. For example, 348*567→AB would load the upper 16-bits of the multiplication to A and the lower 16-bits to B. Finally, I was thinking of adding a new syntax where instead of using A', you can use lowercase A, as well to mean the same thing. That might also cause less clutter in the program editor, too, if you can do →a instead of →A'.

Also, I plan to add all this today.

EDIT: Displaying the small fixed size font at pixel coordinates is now able to be done. This outputs with OR logic as a warning. You will need to do Output(2 to access this method.
EDIT2: Text( without arguments now returns the coordinates as Ans=Y, Theta'=X
Also, you can now do things like →AB :D
EDIT3:→a is now a valid way to do →A' (Still not able to use lowercase anywhere else in place of primes)
EDIT4:Now you can do math with the lowercase letters instead of primes and use them as arguments :)
Title: Re: Grammer 2-The APP
Post by: Yeong on March 21, 2012, 06:47:05 pm
yay, updates!
I love the →a part since it'll save some spaces (not the size, though :P)
also, is →AB for 32-bit numbers?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 21, 2012, 09:30:01 pm
Yes, it is  :) I am waiting for the "Latest Grammer Updates" thread to be unlocked because an admin locked it >.>

Anyways, so →AB is useful when a function returns info in theta', too. For example, like above, multiplication returns the 16-bit overflow in theta', so if you want it all in one 32-bit number, just use two vars. Plus, now you can do something like A*B→aA.

Anyway, for now, here is the app :) (have fun!)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 08, 2012, 10:33:12 am
So I finally found the motivation to code and I just "gray enabled" Tangent(. Now you can shift other buffers in your desired direction :) (This is in response to one of Yeong's old requests). Now, there are a few things that I have been meaning to add, but I have forgotten what they were, so for now, I will try to clean up the readme a bit more .__.
Title: Re: Grammer 2-The APP
Post by: Yeong on April 09, 2012, 06:10:28 pm
Ooh. :)
Is the syntax for arbitrary tangent same as the other's? (Extra syntax, I mean)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 09, 2012, 09:15:26 pm
Yep, just add the buffer argument to the end :)
Title: Re: Grammer 2-The APP
Post by: DJ Omnimaga on April 09, 2012, 09:23:50 pm
Nice update Xeda. And I assume the text updates are mostly for custom Input routines, right?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 09, 2012, 09:30:24 pm
The main reason for those was that I wanted to easily be able to do pretty-print styled writing :) It also allows for much finer control for text effects, especially for inputs and menus.
Title: Re: Grammer 2-The APP
Post by: Yeong on April 09, 2012, 10:01:47 pm
can text have non-multiple-of-8 x coordinates now?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 09, 2012, 10:03:10 pm
Well, it was 4x, but yeah, if you use Output(2, it will use the fixed size font (4x6) but it lets you draw to pixel coordinates and Output(1 uses the variable size font and has always used pixel coordinates. Output(0 is the default font.
Title: Re: Grammer 2-The APP
Post by: Yeong on April 09, 2012, 10:04:45 pm
When you upload the readme, I'll probably have to look it over again XD (Since there were a lot of undocumented commands in read-me -_-;)
and it'll help me writing a tutorial as well. :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 09, 2012, 10:06:10 pm
Yeah, I am trying to rewrite the tutorial/command readme, but it is a slow process .__. I have a few pages done :/
Title: Re: Grammer 2-The APP
Post by: DJ Omnimaga on April 10, 2012, 10:03:34 pm
The main reason for those was that I wanted to easily be able to do pretty-print styled writing :) It also allows for much finer control for text effects, especially for inputs and menus.
Ok thanks for the info. And yeah I could see this used for example in RPGs where you type names or if someone wants to do something like Ultima, where you type commands to talk to NPCs and other stuff.
Title: Re: Grammer 2-The APP
Post by: Yeong on April 14, 2012, 07:20:27 pm
@Xeda: will it be possible to send me the one with just the syntax?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 16, 2012, 10:29:36 am
Do you mean the app with just the text syntax? I am confused -_-'
Also, sorry, I was without my computer for a few days more than I expected x.x
Title: Re: Grammer 2-The APP
Post by: Yeong on April 16, 2012, 09:54:21 pm
what I wanted was the readme with all the syntax-es for Grammer, but not necessary the tutorial part.
Title: Re: Grammer 2-The APP
Post by: persalteas on April 21, 2012, 12:01:03 pm
Hello.

I didn't told you, but I have translated your "Commands and tutorial v2.25.03.12" in French, I re-organized it , and I added a lot of comments from myself. (not totally finished).

So, this forced me to start programing with Grammer :D

I put the App on my calc (v 2.28.11.11), and my calc crashes every time I quit the app (pressing [clear] ).
Why ? Is it the good version I have ? (your signature says v2.25...)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 21, 2012, 12:36:27 pm
hmm, that is a rather old version... I started the version number as:
2.day.month.year

So 2.28.11.11 == Grammer 2, revised 28 Novembre 2011

Still, that is weird that it crashes, do you have other apps installed that might conflict?

Also, awesome job with translating the readme o.o I am glad you put in comment, because it will help. Do you have it uploaded somewhere? I would like to read it, too o.o

EDIT: This is the latest release http://ourl.ca/15327/293492
Title: Re: Grammer 2-The APP
Post by: persalteas on April 21, 2012, 01:09:53 pm
Quote
do you have other apps installed that might conflict?

Doors CS 7.1.1 / XtraTkn / PrettyPrint / CtlgHelp

But I when I tried it the first time, I had the OS 1.16 (old) on my calc (don't ask why x) ).
I have now the 1.19, I sent the Grammer App again, but if the App had saved things in the Archive memory the first time, they may be corrupted.

About the french adaptation-translation: It's not finished, I'll send you ... Monday, or before.

Did you write other technical infos about programing with Grammer in another document ? 
For example, I saw that we should start our programs by ":.0: ", that's not said in the "commands and tutorial".

A lot of stuff and important information is missing in this doc. My simple adaptation won't be a real tutorial. (Or maybe in the future, if you show me where I can find more info.)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 21, 2012, 01:22:59 pm
Hmm, that is true, I never did put those in the readme, that isn't good D:

Um, important info
Start with .0: I typically do .0:Return in case Grammer isn't installed or something crazy like this:
Code: [Select]
.0:Disp "ERR:Grammer prgmGammer2 needed.":Return
Also, you need to exit the program some way. Grammer cannot tell if it has reached the end of the program, so you need a "Stop" to tell it.

Also, I am not sure how well it will work on old OSes but I am pretty sure they should work :/ I will try it myself, too.
Title: Re: Grammer 2-The APP
Post by: persalteas on April 21, 2012, 02:23:25 pm
OK.

I have several questions to ask (I'm not sure I have all understood), maybe it's not the good topic.

I have bad understood about what interrupts are (En Français, "interrupteurs" ??), it allows the prog to execute 2 code parts at the same time ?

And I don't understand too what you mean by "*By adding 8 to the Method, the data will be read as hexadecimal". Is there another mean to code sprites than hexadecimal ?

I have more questions, but these two are principals :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 21, 2012, 04:26:33 pm
Okay, I can try to answer these :)
I have bad understood about what interrupts are (En Français, "interrupteurs" ??), it allows the prog to execute 2 code parts at the same time ?
Interrupts do not work well in Grammer, but for some short pieces of code they will work. They let you run a subroutine automatically several times per second. This feature is not finished and will change in the future. (In fact, I am going to try to change it today to make programs run a tiny bit faster and have extremely good control of the interrupts).

And I don't understand too what you mean by "*By adding 8 to the Method, the data will be read as hexadecimal". Is there another mean to code sprites than hexadecimal ?
There are two ways to store sprite data. One is by making pure data, and the other is by using hexadecimal. Using hexadecimal is easier, but the data is twice as big. Thank of it like taking a hexcode and using AsmComp(. Also, using hexadecimal code requires Grammer to convert the data before drawing it.

I have made a few sprite editors to help making sprite data easier.
Title: Re: Grammer 2-The APP
Post by: persalteas on April 22, 2012, 12:20:28 pm
Ok, thanks.  =)

So...I reseted all my RAM and ROM, Grammer alone on the calc continues to crash when you leave the App by pressing [clear].

I report an other bug:
When your calc freeze or when your manually clear your RAM, do a little calculation before using Grammer, just hit [1][enter] for example.
If you don't do this, you shouldn't press [enter] after leaving the Grammer App, or your calc will crash again. (Usually, the calc says "Done" when you press [enter] after a "RAM Cleared".)


Is Grammer able to run archived progs ? Is it better to launch the progs from the App, or from the [prgm] menu ?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 22, 2012, 12:23:35 pm
Hmm, that is an odd bug, I wonder how to fix it... I will see what I can do. Also, I am using the latest version of Grammer on OS 1.19 and it works fine :/

EDIT: It works on 1.10 as well

EDIT2: I noticed that when I ran it, the RAM cleared message was not deleted from the screen on OS 1.03, so when I exited, it still showed that. However, it was not RAM cleared.

EDIT3: And yes, it can run programs from archive :)
Title: Re: Grammer 2-The APP
Post by: persalteas on April 22, 2012, 12:54:16 pm
I will survive with it, but that's bad... :(


Spoiler For Spoiler:
Yeah, 40 posts, let's talk in OmnomIRC !!! :) :) :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 22, 2012, 02:12:59 pm
okay, I fixed it :) Also, I am not sure if I uploaded since I fixed the Tangent( command to work on arbitrary buffers, so that is also included. I'm not sure what else I have added or fixed D:


EDIT: Also, I plan to finish up the interrupts thing, soon, and if it works the way I want it to, it will be extremely powerful. It will let you run multiple "interrupts" at custom frequencies.

EDIT2: in otherwords, if you want to download this one, go ahead, but it might be outdated in the near future XD

EDIT3 I now have it working, but I won't do multiple interrupts. The new version is uploaded.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 26, 2012, 03:34:25 pm
I figured I should let you all know that in about 1 week, I will be on summer vacation which means I won't have much internet access. This has a few consequences (good, mostly):

1) I will be wrapping up Grammer 2 :'(
2) I will be starting in on Grammer 3 :woot:
3) I will need to start taking requests now, since I won't have internet. I will open up a topic for Grammer 3 after this.
4) I must now hope things go according to plan and I need to tease out all possible bugs. I will still be adding stuff to Grammer 2 while I work on Grammer 3 (like more Widths available for Pt-Off, more tilemap options, any optimisations, et cetera).
Title: Re: Grammer 2-The APP
Post by: persalteas on April 26, 2012, 03:43:39 pm
bugs:

1) I can't quit the app by pressing [F4] (EXIT) or [CLEAR]  ----> RAM Cleared

2) When a Grammer program finishes, I can't shutdown my calculator until I press a key which displays a menu ( like [prgm], [stats]...)

and then I had other crashes, but while a program execution. Maybe it was my fault, if I try bad commands. (like displaying a number in base 1)

Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 26, 2012, 04:07:22 pm
bugs:
1) I can't quit the app by pressing [F4] (EXIT) or [CLEAR]  ----> RAM Cleared

2) When a Grammer program finishes, I can't shutdown my calculator until I press a key which displays a menu ( like [prgm], [stats]...)

and then I had other crashes, but while a program execution. Maybe it was my fault, if I try bad commands. (like displaying a number in base 1)
The first bug should not occur D: Which version do you have? It still works fine for me The last update was here:
http://ourl.ca/13558/298071

The second bug should not happen, either D:
Is your program ending with the Stop token?  Do you have other apps running (even then there should be no interference).

About the third bug (displaying in base 1). You are right, I should fix that D: Sorry :[

EDIT: Fixed. I just make it not display anything if the base is 1 or 0.
Title: Re: Grammer 2-The APP
Post by: persalteas on April 26, 2012, 04:17:31 pm
AH, I have the v2.26.02.12 ... I'll update.

Yes, my programs finish with Stop. And if they don't, I don't have the bug, my calc still shutdowns.
The problem comes from the Stop token I think.

I have the Hooks of MirageOS and XtraTkn (and Grammer). But the F4/CLEAR bug was here before I put these apps, I'm sure. Not sure for the Stop.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 26, 2012, 05:17:20 pm
Yes, the F4 bug might have been because I did not add it to that version yet (even though I had the menu). And version 2.26.02.12 is exactly 2 months old now o.o
Title: Re: Grammer 2-The APP
Post by: persalteas on April 27, 2012, 10:30:55 am
La version 2.22.04.12 n'a plus de bugs, en effet.

Ou presque: on ne peut plus désactiver le Hook une fois activé...

Et à quoi servent les onglets AppV et Asm ?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 27, 2012, 10:52:33 am
Ou presque: on ne peut plus désactiver le Hook une fois activé...
Ouai, je n'ajoute pas le fonction pour désactiver le Hook. (sorry)
Yeah, I haven't added the ability to turn off the hook once it is turned on

Et à quoi servent les onglets AppV et Asm ?
Ces ne sont pas encore implémenté, mais AppV cherchera pour les appvars avec Grammer code et Asm cherchera pour les (Grammer Assembly programs?).

Those options aren't implemented yet, but AppV will search for appvars with Grammer code and Asm will look for Grammer Assembly programs.

(like how there are MirageOS programs, there are Grammer assembly programs, too).
Title: Re: Grammer 2-The APP
Post by: persalteas on April 27, 2012, 11:07:52 am
Okay. :)

(for your personnal knowledge assembly-fr = assembleur :) )
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 27, 2012, 11:13:50 am
okay, thanks ^_^ I will try to fix these, too. Also, I found that →Strx doesn't work, so I fixed that. In the next update it will work :)
Title: Re: Grammer 2-The APP
Post by: Yeong on April 27, 2012, 04:56:02 pm
Nice to hear that Grammer 3 will start soon. :D
So...menu access?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 27, 2012, 07:25:33 pm
What do you mean by "menu access?"
Title: Re: Grammer 2-The APP
Post by: Yeong on April 27, 2012, 10:56:13 pm
I think I saw that you worked on how to access menu from asm program or something. :D
It'll be cool if you implement it.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 28, 2012, 12:25:32 am
I am still confused D:
I've no clue what is going on !_!


EDIT: Do you mean like a Menu( command?
EDIT2: Or do you mean that MenuKeyHook? o.o That I could do, but I have 878 bytes of space left.
Title: Re: Grammer 2-The APP
Post by: Yeong on April 28, 2012, 08:17:34 am
I mean MenuKeyHook. :D
Oh, also, I meant for you to put it in Grammer 3 and I didn't see the topic when I wrote that. :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 28, 2012, 10:42:13 am
Ah, okay :) I'll go ahead and answer it in the other topic then :) I was thinking about adding it directly to Grammer as well, since it is very small. If I do have enough space after fixing everything up, I probably will add it to Grammer 2. I am currently working on rewriting the code for the main menu to be smaller and then add the code to handle all the options.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 29, 2012, 11:47:04 am
Okay, I have been working on this for the past two hours and I now have the main menu working better :) You can now use all of the options:
Gram-When this is highlighted, it only displays programs with a Grammer header
AppV-When this is highlighted, it shows appvars instead of programs
Asm-When this is highlighted, it shows assembly programs. There is a Grammer header for assembly programs, too, just like there are MirageOS programs and ION programs.
Exit-Exits the app
Hook-Currently, this toggles the token hook on and off

Caution: Any program run from this menu is run as a Grammer program or Asm program.

So, again, to summarize:
-You can now run Grammer Asm programs and regular ASM programs from Grammer (The screenshot shows a program I made with Axe)
-You can run a program as a Grammer program, even if it doesn't have the header
-You can toggle the Token hook on or off
-You can look at the program list or appvar list in case you converted your programs to appvars

Also, there are now 655 bytes left, but there is code that I still need to remove.

EDIT: Also, I have been working at cleaning up the readme+tutorial and I am trying to document all of the calls in the jump table so that Assembly programmers can start making Grammer Asm programs.
Title: Re: Grammer 2-The APP
Post by: Sorunome on April 29, 2012, 12:00:34 pm
Wha, cool!/me downloads
Is there anywhere a full documentary of this app? I've been missing a lot in my inactive time... :(
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 29, 2012, 12:01:52 pm
I am currently working on it :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on April 29, 2012, 12:03:40 pm
Cool!
I'll be sure to download and read it :D
I just stuff was more compatible like this somehow:
zStart - Omnicalc - DCS - Grammer - Batlib
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 29, 2012, 12:07:20 pm
If I can do it, I plan to let Grammer do some hook chaining to allow it to be a little more compatible with the others :)
Title: Re: Grammer 2-The APP
Post by: Sorunome on April 29, 2012, 12:08:09 pm
That would be awesome! But the problem would be zStart with running on ram clear :P
And with symbolic and xlib D:
Title: Re: Grammer 2-The APP
Post by: Yeong on April 29, 2012, 03:17:09 pm
Symbolic will be nice, but I don't think xlib is not needed with Grammer, since Grammer can do almost everything that xlib can do already. :D
EDIT: I'm just curious, but is it possible to run apps from grammer program? (or just any kind of program)
Title: Re: Grammer 2-The APP
Post by: persalteas on April 30, 2012, 10:42:27 am
Quote
I'm just curious, but is it possible to run apps from grammer program? (or just any kind of program)

I'm not sure, but If you can find a pointer to the App, you may execute the code like an assembly program.

(I don't know how to run assembly programs in a Grammer code...If a Grammer code runs with expr( , maybe an assembly prog needs Asm(expr( ? )


PS: Quite good readme, now :)  There is much more info.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 30, 2012, 11:33:16 am
Quote
I'm just curious, but is it possible to run apps from grammer program? (or just any kind of program)

I'm not sure, but If you can find a pointer to the App, you may execute the code like an assembly program.

(I don't know how to run assembly programs in a Grammer code...If a Grammer code runs with expr( , maybe an assembly prog needs Asm(expr( ? )


PS: Quite good readme, now :)  There is much more info.
If you know the assembly code to run an app, then yes, you can actually run an app from Grammer. I never even thought about that because it is complicated to do in Assembly.

To run assembly programs, use Asm( and to run hex codes, use AsmPrgm. To execute an App, you want to use AsmPrgm. Be warned that this will exit the program and not return:
Code: [Select]
.0:
Get("EAppName    ;Yes, actually use E. I'm hacking Grammer >.>
AsmPrgm2178843614EF4E4CD8D306C38040
solve(4,2,"App Not Found
Stop
This will leave garbage on the screen in some cases, just as a warning. Also, if the App name does not work, try adding spaces until their are 8 chars. For example, Axe is really named
"Axe     "
Title: Re: Grammer 2-The APP
Post by: Sorunome on April 30, 2012, 11:35:22 am
there's a little bit of garbage, not much xD
Maybe clrscreen would fix that?
Symbolic will be nice, but I don't think xlib is not needed with Grammer, since Grammer can do almost everything that xlib can do already. :D
It would be cool so you have everything in one, so that your calc is all-compatible
Title: Re: Grammer 2-The APP
Post by: persalteas on April 30, 2012, 11:47:11 am
O.o amazing...

Title: Re: Grammer 2-The APP
Post by: Xeda112358 on April 30, 2012, 11:54:58 am
hehe, thanks :)

@Sorunome: If I were to include all that, I would just have one giant app like DoorsCS7 :P
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 01, 2012, 09:42:06 pm
Hmm, new update here (http://ourl.ca/15327/299276). I have added in a better ability to change specific modes using Fix and you can now use StorePic and RecallPic. Even better, though, is the updated particle command ^_^. It now gets about 5.66 FPS with Partex2 and 2048 particles instead of 3.60 and you can customise the rules a little :) For example:
Code: [Select]
P?Ry(2,"D,LR,U
That sets the rule to check the down direction first, if it cannot move down, try left and right, if that fails, check up :D
Title: Re: Grammer 2-The APP
Post by: C0deH4cker on May 01, 2012, 11:27:02 pm
You should consider changing your version structure to be VERSION.YEAR.MONTH.DAY so that the version is always going up, not up and down.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 01, 2012, 11:27:47 pm
Yeah, I realised that in hindsight XD It does get confusing :/ I will definitely do it that way for Grammer 3
Title: Re: Grammer 2-The APP
Post by: persalteas on May 02, 2012, 03:43:22 am
I steal your screen to use it in the news on TI Planet :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 02, 2012, 06:48:18 am
Hehe, I saw :) It's no problem :)
Title: Re: Grammer 2-The APP
Post by: persalteas on May 03, 2012, 04:35:30 pm
Questions relative to your updates:

1) using StorePic or RecallPic : I suppose it's for the OS variables, it's not pointers ?
It it posible to store a specified buffer with StorePic ?

Maybe
Code: [Select]
:Disp piXXXX
:StorePic 1

?


2) P▶Ry(2,"D,LR,U  is exactly the same as P▶Ry(2,2145 ? So why did you implement 2 syntaxes ?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 03, 2012, 04:44:56 pm
1) using StorePic or RecallPic : I suppose it's for the OS variables, it's not pointers ?
It it posible to store a specified buffer with StorePic ?

Maybe
Code: [Select]
:Disp piXXXX
:StorePic 1
That code should work :)
2) P▶Ry(2,"D,LR,U  is exactly the same as P▶Ry(2,2145 ? So why did you implement 2 syntaxes ?
It is because number are easier to modify than strings. However, using a string like that is much easier for the programmer. Also, the letters correspond to Down, Left, Right, Up.
Title: Re: Grammer 2-The APP
Post by: persalteas on May 03, 2012, 04:48:07 pm
Okay, thanks.

Hmh... You said you added features to Sprites and Circles (29/04) what did you add ?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 03, 2012, 04:53:53 pm
Oh, I made some arguments optional. For example, Circle(Y,X,R[,T. It automatically uses option 1, now. For the sprites, you don't need height and width if it is a regular 8x8 sprite.

However, if you need to add other arguments (like a buffer), you will need to have all the arguments before it.

EDIT: Also, I just realised that I will have to make one more update because I broke the feature to run Assembly programs.
Title: Re: Grammer 2-The APP
Post by: persalteas on May 03, 2012, 05:08:09 pm
Okay. I'll update my tuto, with these version of Grammmer, with the Hooks names :) , and the beginning of the second part.
Title: Re: Grammer 2-The APP
Post by: Yeong on May 03, 2012, 10:50:55 pm
@Xeda:

For the fire animation, can you add an optional argument to display the different direction of fire buring? (eg default burns upward. )
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 03, 2012, 10:52:44 pm
Hmm, I might be able to do that :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 22, 2012, 12:08:13 pm
Unfortunately, I do not have the downward flames available, but I hope this update is as awesome as I think it is :)

Things I have added or fixed in Grammer 2:
Code: [Select]
.0:Return
ClrDraw
Text(°"(x,y)=(           ;ClrDraw sets the cursor to (0,0), so I can use °
expr(Input ",)→X         ;I get the next input here. The string is ,)
Text(,+1                 ;This increments the X coordinate.
expr(Input ")→Y          ;This gets the Y value.
Pxl-On(Y,X               ;Or whatever you want to do with the coordinates.
DispGraph
Stop

Title: Re: Grammer 2-The APP
Post by: Sorunome on May 22, 2012, 12:59:25 pm
Wha, that is some very cool feature! I like it!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 22, 2012, 04:07:57 pm
For the curious, here is what grayscale now looks like (it is not quite what it looks like on an actual calc, though >.>
6MHz: (http://img.removedfromgame.com/imgs/GrayEx1.gif)
15MHz:(http://img.removedfromgame.com/imgs/GrayEx2.gif)
Title: Re: Grammer 2-The APP
Post by: Yeong on May 22, 2012, 05:21:52 pm
all right! :D/me downloads
Title: Re: Grammer 2-The APP
Post by: persalteas on June 22, 2012, 06:10:30 am
wow, I really like the Input command now o.o

I have... two things to ask you to modify, and two questions:

1) Could you implement the "increment" argument to For loops ? Even with negative increments ?
For(A,10,0,-1

2) Could you change the order of the Fill(23 arguments please ? :D
I explain:
The Rect( command  :   X/Y/height/width/type
The Fill(23 command: type/Y/X/width/height

I am always wrong with their differences :D

3) What are the differences between length(' and the "list" L commands ?
The doc says the same thing.

4) What is the difference between Output(0 and Output(2 ?

Thanks a lot !
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on June 22, 2012, 02:40:18 pm
Output(2 lets you draw text to pixel coordinates with the small font, Output(0 only lets you draw to 24 columns.

I will definitely try to add in the increment for For(

I don't think I will change Fill(23 as some programs use it already. This would prevent the programs from working properly :/

length(' and L... I cannot remember the difference, sorry :/ I am out of internet time D:
Title: Re: Grammer 2-The APP
Post by: persalteas on June 27, 2012, 11:48:41 am
thanks.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on July 03, 2012, 11:46:13 am
Now problem :) I have an update, too (no new commands). This version has a modified header to work with BatLib and I modified some other code to let BatLib's dim(125) command work :) (that lets you execute inline Grammer code in your BASIC programs).
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on July 27, 2012, 03:16:16 pm
I have an incomplete update here. I forgot to add in the header for GroupHook and I cannot fix this from this computer :/ Anyways, I added two more solve( options to back up and restore all pointer vars. I also added in a useful Menu( function :) It is similar to a popup style menu in that it returns the item number selected and lets you place the menu on the screen at a given location. For example:
Code: [Select]
.0:
If Menu(3,3,48,"Header","Item0","Item1","Item2","Exit→A=3
Stop
!If A
Goto Lbl "ITEM0
...

As a note, the 48 is there to specify the width of the menu.
If you guys have any suggestions on how to modify this command, feel free to suggest :) If I can, I think a scrolling menu would be cool :D
Title: Re: Grammer 2-The APP
Post by: Yeong on July 28, 2012, 07:44:47 am
Great. It'll help some rpg dev :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on August 05, 2012, 04:50:00 pm
Hehe, yes, it does help :D I have been using it in Samocal.
Also, in reference to your current avatar, Advanced Wars has inspired some of my random programming. (Like when making a tilemap that also checks surrounding tiles to see if it needs to be modified. Think of how high mountains are depending on what is behind it.)
Title: Re: Grammer 2-The APP
Post by: Yeong on August 05, 2012, 09:03:36 pm
I like the idea :D
Title: Re: Grammer 2-The APP
Post by: persalteas on September 12, 2012, 08:54:05 am
Nice...

I have completely rewritten the french tutorial, now with 15 detailed chapters (5 big parts or 15 little chapters) :thumbsup:

You can read/download it at the same URL : http://tiemulation.kegtux.org/Grammertutorial.htm

Do you know when you're gonna switch to version 3 ?
The 3 will be 2-page App, if I remember what you said in the appropriate topic.

(And otherwise, excuse me to insist, have you dropped the idea of a 83/82 stats port ? Even a very little port with few features ?
 French students are waiting for it eagerly  :love: )

Thank you again for those updates, I like the Menu !
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on September 12, 2012, 09:03:28 am
I am not sure if I will have the time for the TI-82/83 port. I would like to finish or at least start it this semester or next winter.

As for Grammer 3, I am not starting it yet (I won't start for another year, probably).

The french tutorial is going to be so helpful, thank you for making it!

EDIT: Wow, I just glanced at it and it looks amazing!
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on September 12, 2012, 11:19:48 am
I'm not sure an 82/83 port would really be feasible as you only have ~28k total user space. :/
Title: Re: Grammer 2-The APP
Post by: persalteas on September 12, 2012, 11:35:34 am
before being an App, Grammer was a program...
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on September 12, 2012, 11:38:02 am
Indeed, but there is still the issue of very limited space.
Title: Re: Grammer 2-The APP
Post by: Sorunome on September 12, 2012, 06:57:19 pm
Isn't xeda also planning to develop grammer3?
Title: Re: Grammer 2-The APP
Post by: Yeong on September 12, 2012, 06:59:48 pm
As for Grammer 3, I am not starting it yet (I won't start for another year, probably).
Title: Re: Grammer 2-The APP
Post by: Sorunome on September 12, 2012, 07:00:46 pm
damit, i need to read moar XD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on September 14, 2012, 09:28:54 am
If I made a program version, I think it would be around 5000 bytes and be a port of the Grammer 1. The port would probably be smaller and faster than Grammer 1, too, because I optimised a lot of that code in Grammer 2 :D
Title: Re: Grammer 2-The APP
Post by: persalteas on September 14, 2012, 12:09:07 pm
Good !
Title: Re: Grammer 2-The APP
Post by: Sorunome on September 14, 2012, 06:42:44 pm
Nice! But wouldn't it have to be in ram then? :P
Title: Re: Grammer 2-The APP
Post by: persalteas on September 15, 2012, 06:54:48 am
Yes it will be in RAM... You cannot write into the ROM with a 83/82, read only
Title: Re: Grammer 2-The APP
Post by: Sorunome on September 15, 2012, 11:29:24 am
that's why i hate ram clears >.>
Title: Re: Grammer 2-The APP
Post by: Yeong on September 15, 2012, 01:33:19 pm
Especially in TI-86, which actually have some high quality games, but only RAM space D:
Title: Re: Grammer 2-The APP
Post by: persalteas on September 16, 2012, 04:36:58 pm
Wow Grammer on a 86 would be... nice too ! I have one and I never programmed on it...
Title: Re: Grammer 2-The APP
Post by: Yeong on September 16, 2012, 05:34:40 pm
For TI-BASIC, iirc, It's really similar to TI-83+ TI-BASIC.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on September 17, 2012, 07:47:33 am
If Grammer gets ported to the TI-86, 4-level grayscale has to come as a standard drawing mode XD Same for the 89 and 92...
Title: Re: Grammer 2-The APP
Post by: Sorunome on September 17, 2012, 08:25:26 pm
wow, nice :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 06, 2012, 09:15:20 am
I remembered a feature that I never added to Grammer 2 D: Parser hooks would have made this project great, but I think I have a better idea... When an unrecognised token is come across, code can be redirected and parsed by the program. I would try to use the token "?" somehow to read arguments. This would also let me add in the ability to pass arguments to subroutines "easily." What do you guys think?

EDIT: Okay, what I have added so far:
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on October 07, 2012, 10:02:00 am
Sounds awesome Xeda! :D
Title: Re: Grammer 2-The APP
Post by: Yeong on October 09, 2012, 08:32:31 am
sweet. extra variable. :D
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 09, 2012, 09:30:45 am
Yes, it can be used as an extra variable >.> You can store to it, use it for math, and all that good stuff :P

Also, when I was trying to pass unrecognised tokens to the error handler, I found out that I had broken it. As well, there was another piece of code that has probably been broken for a while that I finally teased out. Anyways, I added these features in all:



I am going to see if I can find any more bugs before I release it, though.

EDIT: @Yeong: I saw your review on TICalc, by the way and I've forgotten to mention this:
Quote
I just wish that it could support multiple keypresses, though.
You can test directly for keys. For example, getKey(3 lets you test for right and getKey(2 lets you test for left. If you are pressing both keys, a 1 will be returned in both cases.
Quote
With the "Full" mode (just like Axe), Grammer programs can be run at amazing 15MHz speed(Of course, the 15MHz limited to 84+SE
Full works on the TI-83+SE, TI-84+, TI-84+SE. Basically, the only calc in the series it won't work on is the TI-83+.
Title: Re: Grammer 2-The APP
Post by: Yeong on October 09, 2012, 04:52:29 pm
@Yeong: I saw your review on TICalc, by the way and I've forgotten to mention this:
Quote
I just wish that it could support multiple keypresses, though.
You can test directly for keys. For example, getKey(3 lets you test for right and getKey(2 lets you test for left. If you are pressing both keys, a 1 will be returned in both cases.
Quote
With the "Full" mode (just like Axe), Grammer programs can be run at amazing 15MHz speed(Of course, the 15MHz limited to 84+SE
Full works on the TI-83+SE, TI-84+, TI-84+SE. Basically, the only calc in the series it won't work on is the TI-83+.
1. Oh. It didn't work for me last time. Maybe my version is old? /me upgrades
2. Oops. I forgot to mention those models XP
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 10, 2012, 06:54:36 am
:P Also, getKey( has been around since the program version :D
Title: Re: Grammer 2-The APP
Post by: Yeong on October 10, 2012, 09:55:44 am
well I knew that, but I remember that I always had to press 2nd and arrow keys separately instead of pressing them altogether to make my sprite jump and move at the same time
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 11, 2012, 12:23:31 pm
Huh, that is actually weird. I've never had the problem :[ Maybe you added something to your code that caused it?
Title: Re: Grammer 2-The APP
Post by: Yeong on October 11, 2012, 03:23:58 pm
I did If getKey(blah).....If getKey(blah)..........
am I doing something wrong?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on October 11, 2012, 05:37:32 pm
No, that should work. I will test it at some point, but it has worked for me.
Title: Re: Grammer 2-The APP
Post by: Yeong on October 11, 2012, 07:06:24 pm
Ok. But I think I'll still upgrade XD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 08, 2013, 01:08:12 am
For Yeong's sanity, I will post this update. I have no clue how many bugs or issues were addressed (I lost my progress log), but it seems that the last major release had issues with displaying large numbers and this veriosn has it fixed. As well, there was an issue with the ReadArc routine that was causing crashes. That has been fixed.
Title: Re: Grammer 2-The APP
Post by: Yeong on January 08, 2013, 01:12:20 am
Hooray my sanity
Dat Grammer was punishing me bit too much for not backing up progress every hour or so with dat archive crash :P/me downloads
Title: Re: Grammer 2-The APP
Post by: Yeong on January 08, 2013, 04:58:53 pm
Err xeda the fix can't run archived program at all -_-
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 09, 2013, 12:29:40 am
I am having no problems running archived programs o_O And I am positive that the fix didn't break archive support.
Title: Re: Grammer 2-The APP
Post by: Yeong on January 09, 2013, 05:43:20 am
It gives me ERR:?
Do I have to delete gramVar appvar?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 09, 2013, 10:39:52 am
The Grammer appvar shouldn't interfere at all. Check your version to see if it sent correctly?
Title: Re: Grammer 2-The APP
Post by: Yeong on January 09, 2013, 11:27:02 am
Its a july version.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 09, 2013, 11:36:20 am
That is weird, you said it works on no archived variables? I downloaded the version I posted to make sure it was in fact working and I had no problems. I actually did get an Archive error the first time, but that was because sending the app disables hooks, so I had to run Grammer to reinstall the hooks. I even tested it to make sure the program was on a page boundary and that still caused no problems.
Title: Re: Grammer 2-The APP
Post by: Yeong on January 10, 2013, 05:50:43 am
Well actually it won't run programs at all O.O
Maybe my downloaded version is somehow corrupted?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 10, 2013, 10:16:03 am
Maybe. That is definitely not a bug present in any recent version.


EDIT: Fixed the issue. What was happening is that I added in an error for unrecognised commands. The parser was getting to the degree symbol and saw it as an unrecognised command and threw ERR:? . I modified it so that the degree symbol is now just ignored as a command, which is essentially what happened in the older versions (I just had an RET for that error, now I actually pass an error).

So luckily it was not anything to do with the archive or RAM or anything like that XD

Title: Re: Grammer 2-The APP
Post by: Yeong on January 10, 2013, 09:24:04 pm
Wait so I can't store 16bit stuffs with degree symbol anymore? D:
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 11, 2013, 12:30:44 am
You can do that, that won't be a problem. I just mean that by itself the degree token isn't a function. I just marked it as a token that shouldn't be parsed as a function, but any commands like Text(, Disp or [ that use it as a modifier will recognise it.
Title: Re: Grammer 2-The APP
Post by: Yeong on January 11, 2013, 07:16:04 am
Oh ok.
Then I'll put it in my calc soon. :D
EDIT: It seems like Grammer is not handling the degree symbol properly. I am not getting the result that I want to get. (certain number is returning zero when it shouldn't be)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 12, 2013, 12:53:57 am
Really, this must be rather annoying, so I am sorry .__. This version has that issue fixed, hopefully nothing else was introduced :[
Title: Re: Grammer 2-The APP
Post by: persalteas on January 22, 2013, 04:00:35 pm
I have an "ERR:?" .

What is it ?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 22, 2013, 04:03:45 pm
When you select GOTO, which token does it go to? ERR:? is thrown when Grammer sees an unsupported token. I probably forgot to have it ignore a few more tokens.
Title: Re: Grammer 2-The APP
Post by: persalteas on January 22, 2013, 04:08:18 pm
It goes to the ".0:", on the dot, at the begining of the program.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 22, 2013, 04:15:30 pm
Oh, then are you using a program that jumps to external code? Or using expr(Input ?
Title: Re: Grammer 2-The APP
Post by: persalteas on January 22, 2013, 04:19:02 pm
Yes, I use a expr(Input. But I input regular tokens...
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 22, 2013, 04:20:11 pm
hmm, that is weird. Is it anything that you input, or something specific?
Title: Re: Grammer 2-The APP
Post by: persalteas on January 22, 2013, 04:25:12 pm
Each time, I input a digit between 0 and 10, to give a value to var A
B is random integer.

further in the code, there are conditions to test if A=B. If it's false, the error happens, if it's true, no problem...
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 22, 2013, 04:27:58 pm
Wait, so does the error occur when you use expr(Input, or at some other part of the code? If you want, you can upload the code that is having issues so that I can test it myself.

EDIT: For those worried, the problem was fixed and thankfully it wasn't a Grammer bug :w00t:

Also, I accidentally edited Persalteas' post with the edit. I fixed it, though  :-[
Title: Re: Grammer 2-The APP
Post by: ghest1138 on January 24, 2013, 10:56:25 am
Sweet! ;DNow I just need to learn Grammer :3
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 24, 2013, 05:07:14 pm
Awesome! If you ever need help, there is a Grammer Programming and Support (http://www.omnimaga.org/index.php?board=202.0) board where you can ask questions and whatnot. I hope you like it!
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 27, 2013, 07:35:24 am
I worked on Grammer a little bit yesterday and at some points I  had precisely 0 bytes of coding space. However, I removed two undocumented experimental routines for sending/receiving bytes over the I/O port and now there are 69 bytes of coding space available!

As to the updates, I may have broken some things because I made a few more complicated modifications. I am pretty sure that I checked everything that could be affected, but I may have missed something.
Code: [Select]
oZ           ;o is supposed to be the degree token
Text(0,0,"HI!
Text(6,0,"This is on another buffer.
Pxl-On(3,3
Text(0,0,"HI!     ;This is now drawn on the main buffer since the Pxl-On( command resets the temporary draw buffer
It also happens that this works for the particle commands as well, so now you can draw particles on back buffers without using complicated techniques.
Title: Re: Grammer 2-The APP
Post by: persalteas on January 29, 2013, 03:24:28 am
Yay ! what awesome changes in 69 bytes !  :crazy:

My problems seem to have influence on the Grammer developement, I like that  :thumbsup:
Thank you very much for the ° token.

But I have a question about it:

Code: [Select]
:<stuff>
:°Z
:AddPart(stuff
:RunPart
:PxlOn(stuff

I understood that Addpart will use the buffer pointed by Z, what about Runpart ?
It still updates pi9872, or Z automatically ?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 29, 2013, 06:42:07 am
 °Z is meant to work with RunPart :) Actually, AddPart does not require a buffer. If you want, you can use AddPart() with one buffer, then switch the buffer for RunPart and the particles would still be in the correct location on the new buffer.

Also, I think there were 18 bytes when I updated it, but I found extra code to delete XD
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 09, 2013, 04:30:57 pm
Hmm, I don't think I ever documented the Plot1( and Plot2( commands for Grammer. I started making an experimental version last night and I added in a few other special commands. Plot1( will return the value of the byte directly following it and Plot2( will return the value of the two-byte word directly following it. These are more useful if a program was *cough*  compiled since you cannot directly use byte and word values from the BASIC editor.
Not to get anybodies hopes up, but I did start trying to make a compiler for an unofficial version of Grammer. If it speeds things up nicely, I might include it in an official release.
Title: Re: Grammer 2-The APP
Post by: Joshuasm32 on May 09, 2013, 07:07:15 pm
I also have never learned Grammar but probably should..   :-[
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 09, 2013, 07:38:24 pm
It's fine. If I make Grammer 3 (hopefully this summer) it will be much more worth learning that. It will be about 1 gazillion times more powerful, I think.
Title: Re: Re: Grammer 2-The APP
Post by: DJ Omnimaga on May 09, 2013, 10:34:49 pm
Do you still plan a TI-84+CSE release, by the way?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on May 10, 2013, 06:22:45 am
I think I will wait until I have the calculator so that I can test the changes.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on June 03, 2016, 08:48:33 pm
Good news, everyone!

Two days ago, somebody who I will name only as Mx. Burch until I have permission otherwise, emailed me with a modified source for a newer version of Grammer than what I had. I had lost mnths of sourcecode for those who were not aware, and that basically killed the project.

They altered some code,  and I have not extensively tested the code, but hopefully there are no new bugs. Please be advised that this is an experimental version. If I work on this more, some of the additions will almost certainly change.

What was added? The >DMS token (in the Angle menu) is renamed "module" and tells the parser to search for a command in an experimental module. The availabe functions are TEXT( and DISP (with a space after it). These do precisely what the tokenized versions do (Text( and Disp, respectively). The appver Grampkg must be in RAM for now.

What was removed? The jump table is currently removed, so assembly programs using Grammer routines will likely crash. The 32-bit multiplication routine which is entirely unused in the app was removed, apparently the font was compressed, and I scrapped the custom VAT searching routine and I'm now just using the OS routines.

This leaves 927 bytes free! I plan to remove the menu and input commands to an external module since those aren't speed-critical.
Title: Re: Grammer 2-The APP
Post by: Sorunome on June 04, 2016, 02:12:21 am
wow, this is some quite awesome news! Did Mx. Burch have the source otherwise or did they re-write it?
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on June 04, 2016, 02:40:12 pm
From the looks of it, I think they disassembled the app and used older source code as a reference to piece it all together.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 08, 2018, 09:49:11 am
I have been cleaning up code and doing some optimizations and modifications. I probably broke something, but I wanted a backup.
Updates:

Features I want:
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 12, 2018, 09:56:38 pm
After only 7 years, a real  menu!:
(https://i.imgur.com/rKafxMt.gif)
Scrolling up is noticeably slower than scrolling down.
Title: Re: Grammer 2-The APP
Post by: Stefan Bauwens on November 13, 2018, 02:19:36 pm
Looking good Xeda :)
Title: Re: Grammer 2-The APP
Post by: TIfanx1999 on November 14, 2018, 02:18:29 am
Nice! I wonder why scrolling up is slower though...
Title: Re: Grammer 2-The APP
Post by: Eeems on November 14, 2018, 09:59:18 am
From a conversation on IRC it's due to searching through the VAT in reverse. I believe @Runer112 had some suggestions on how to speed it up though.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 19, 2018, 03:44:40 pm
Code: [Select]
13 Nov. 2018
  - Cleaning up code, removing (at least temporarily)
    routines that aren't vital, or useful.
      - Fire graphics code.     **Probably temporary.
      - Factoring code.         **Probably permanent.
  - Optimized CopyHex
  - ConvHexStr is reorganized to be smaller
14 Nov. 2018
  - Optimized ConvOP1 to be smaller, updated performance
    analysis
  - Optimized GetPixelLoc 3 bytes smaller, 10cc faster
  - Optimized ReadArc routine. 3 bytes smaller, 18cc
    faster for archived data, 3cc slower for data in RAM.
  - Removed LoadTSA as the only internal usage was to load
    the ReadArc routine. Instead it is a specialized routine
    that no longer destroys IX. Next savings of 11 bytes,
    even after extended the mov9 LDI chain to a mov13. Saves
    172cc overall (186cc, actually, since no more ld ix,**)
  - Error also takes advantage of mov13, saving 2 bytes.
  - Added a few more fixed-size moves, including mov768.
    Total cost was 6 bytes.
  - ClrHome uses the faster SetSmallMem, saves a byte.
    Makes it 901cc faster, roughly 21% faster
  - I removed the unknown routine I labeled "lbl000", as it
    isn't used anywhere (or shouldn't be!) It looks like an
    attempt at making an off-page call, probably when the
    low mem scared me.
  - Optimized and fixed IsHexTok. It used to accept the
    ' and ' token as equivalent to 9. Saved a byte and 2cc
    when the token was 0~9.
  - Optimized DE_Times_BC. No change in size, 120cc faster
    in the average case. No longer leaves A=0.
  - optimized HL_Div_BC to be 264cc faster on average, with
    a net cost of five bytes. DE_Div_BC is now the
    subroutine, though, and is 272cc faster than if you had
    called it previously. Nearly 18% speed up
  - Fixed SearchString at a cost of 8 bytes, but should
    perform roughly 4 times faster. Also, there is now no
    risk of it entering an infinite loop, an issue the
    previous routine had.
  - SqrtHL is optimized. Actually replaced with SqrtDE.
    Saved 2 bytes, on average 261cc faster (20.17% faster).
    Worst case is still 165cc faster (12.75% faster).
15 Nov. 2018
  - I replaced the Sqrt routine with Runer112's from Axe.
    It is 221cc faster with the small modifications on my
    part to fit the output registers, and 2 bytes smaller.
    That's roughly 21.5% faster.
  - Removed ConvNumBase and HL_Div_C. HL_Div_C was only
    used by ConvNumBase, and ConvNumBase wasn't used
    anywhere in the code.
  - Changed Is_2_Byte. It's no faster or slower, just
    a little more sensible and readable.
  - Removed HexTok and GetHexAtDE.
  - Moved CompatCall so it didn't have to JP to
    IsOP1GrammerProg, saving 3 bytes and 10cc
  - Removed EndHook2 as it appears unused?
  - Optimized ONErr to be 1 byte less, 2cc faster.
  - Optimized TileMap1. 21cc faster, 2 bytes smaller.
  - Removed HL_SDiv_BC replacing the only use of it
    with a wrapper around a call to HL_Div_BC.
    Net 21 bytes smaller. Signed division command now
    averages about 47cc faster.
  - Removed PutIM, ParseFullArgI, CallI, CopyZStr,
    CreateZVar, FindVar.
  - Renamed memory addresses in the Menu command.
    May have messed something up.
  - vPutscr is 1 byte smaller, 3cc faster.
  - Optimized DrawRectToGraphI since it didn't need
    to preserve registers. Saved 9 bytes.
19 Nov. 2011
  - Did some testing and fixed some new bugs.
  - Fixed LoadReadArc. Needed 6 more bytes, saves
    another 76cc.
  - Opted to use interrupts for the Pause routine. It
    isn't as close to 1/100 seconds, but it is more
    energy efficient, smaller, and more reliable.
No screenshots as it's just behind-the-scenes code modifications.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on November 23, 2018, 12:50:37 am
I'm too tired for a full report, but I'll use this as a backup.
I fixed a few bugs introduced in the last version, optimized and cleaned up some more code, and most importantly, I totally overhauled the module system. I renamed the token to just '$'. By storing to it, you can basically register a module to be searched after the default one is searched. At the moment, up to 5 additional modules can be used, which could greatly extend the functionality of Grammer. They can be archived now, and I moved the Menu routine to an external module (appv Grampkg). I still need to do a lot of documentation, but not tonight. Attached is a screenshot of what the code looks like (with the token hook). Good night y'all.
Title: Re: Grammer 2-The APP
Post by: ClainBill on November 23, 2018, 03:29:48 pm
Looks awesome
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 28, 2019, 08:14:26 pm
Grammer has a few new commands since the last update.
So an example program using the GFLOAT module to get the pi and e constants:
Code: [Select]
.0:Return
ClrDraw
ClrHome
"5GFLOAT→$
π8800→X+4→Y
$π→.X
$e→.Y
For(A,0,7
√(.X*.Y→.X
Text(A*6,0,.X
DispGraph
End
Stop
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on January 31, 2019, 11:59:06 pm
I made the readme a little easier to read, splitting it up into different files and using tables. I also added in support for automatic conversion of a number to a float if there is a decimal point in there. For example, 3.0 is now converted to a float and its pointer is returned (where it is stored in temp memory). See the readme for a slightly more detailed look at how Grammer handles floats. Finally, a really minor modification was that I found a size and speed optimization in pixel plotting, so you will now be able to get in an extra pixel or two per minute! :P
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on February 20, 2019, 03:54:37 pm
I fixed some bugs including one with the rectangle routine, line clipping, and floating point conversion (to and from strings). There was a serious bug in the str->float routine that caused it to overwrite the source code when the integer part had an even number of digits :|
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 12, 2019, 02:36:33 pm
I've been fixing more bugs added at least one new command, and modified a few more. Of note:

Attached is Grammer 2.50.2.0 as well as a screeny of a program using the ▶Dec command.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 18, 2019, 01:27:11 am
Grammer now has some basic stack support and easier parameter parsing!

To accomplish the stack routines, Grammer keeps track of three values: The stack base, the stack top, and the stack pointer. Grammer can detect overflows in either direction. I decided to make these actual variables that you can interface with via the Pmt_Bgn and Pmt_End tokens (found at the end of the Finance app). When storing to Pmt_Bgn, the stack pointer is automatically reset. Currently, the stack defaults to saveSScreen+256 and ends at saveSScreen+768, so you have 512 bytes to work with. If you want to relocate the stack, you may. For example, you could create a temp var of 10000 bytes and have a giant stack there !

To push, use Param' followed by an arbitrary number of parameters. To pop, use Param° followed by an arbitrary number of parameters that must be variable names. For example, to swap A and B, you could do:
Code: [Select]
Param'A,B
Param°A,B


The unmodified Param token also takes variable names as its input. A while back, I added the ability for subroutines to be called with arguments, kinda. In order to parse those arguments, you had to do something like:
Code: [Select]
]?→A
]?→B
]?→C
But now you can do:
Code: [Select]
ParamA,B,C


I plan to add the  ▶Nom( token to save variables and then restore them at the end of a subroutine. It is basically just an automated sequence of pushes and pops.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 19, 2019, 10:41:10 am
I added the ▶Nom( command and it is actually implemented as a code block like this:
Code: [Select]
:▶Nom(x,y,z
:<<do stuff>>
:End
What it does is it pushes the list of variables to the stack and when it's End is reached, pops them back off.

My original plan was to make this command useful in subroutines, where when the subroutine's End was reached, it would restore the variables and then exit. However, that was hackish in a future-migraine way, and in implementing it, I realized this routine could be a much more useful as an explicit block.

While coding this, I realized I needed to add ▶Nom( to the internal list of block tokens and found a long standing bug in the routine that finds a block's matching End token-- it wasn't discarding the second byte of a two-byte token. This means, for example, that if a two-byte token's second byte was, say, $D4, it would be interpreted as an End token ! Fortunately, this would only happen in hacked variables (not useful in Grammer) and the (potentially useful) character tokens for ~, @, #, $, and &.

Anyway, here is v2.50.4.0 :)
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on March 29, 2019, 09:50:21 am
I forgot to upload it here!
With the recent updates to z80float, I updated the existing float routines and added in the rest.

I also changed the token hook so that e^( was no longer renamed 2^(. The regular routine still performs 2^n, but the float routine will compute exp(x).
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on August 23, 2019, 08:37:59 pm
I rewrote the Input routine and ran into some issues that I finally managed to fix. Now, the cursor blinks, and you can change the location and size of the input buffer! Here is a screenshot where I relocate the input buffer to a spot within the source code (!), and limit it to 9 bytes (8 bytes plus a null byte):

(https://i.imgur.com/CUxnSE3.gif)

The two new "commands" are →Input (Sets the location of the input buffer) and →Input' (Sets the size of the input buffer).

Title: Re: Grammer 2-The APP
Post by: Xeda112358 on September 03, 2019, 12:46:32 am
Grammer now has proper support for big sprites! With the Pt-Off( command, you can now specify a width argument and it will actually work (with proper clipping, too).

I also totally overhauled the Menu( command. On the surface, it will look largely the same, except that now it allows scrolling if their are too many elements. Internally, it requires a much smaller memory footprint and has a more powerful menu interface. To take advantage of this, I added the Menu(' command. With this one, you can supply two Grammer subroutines to compute the outputs. The syntax looks like:

Code: [Select]
Menu('"Title",y,x,height,width,GET_ELEMENT_ptr,SELECT_ELEMENT_ptr
The subroutine for GET_ELEMENT will receive the index in Ans. Return 0 if it is out-of-bounds, else return a pointer to the string to display. The subroutine for SELECT_ELEMENT will receive the index in Ans. Modify this as you want, the result will be returned as the result of the menu. 0 is returned if the menu exited due to [CLEAR] or [ON]. An example is:

Code: [Select]
Lbl "GET→A
Lbl "SEL→B
Menu('"Title",2,33,59,30,A,B→M
Text('0,0,M
Stop


.GET
→X<26
If !
End
"ITEM A→Z
int(Z+5,X+65
Z
End


.SEL
+1
End
That will display items with the name "ITEM A" through "ITEM Z".
Title: Re: Grammer 2-The APP
Post by: E37 on September 03, 2019, 01:44:56 pm
Ok, you can stop now. Look, if you continue, you will convince me to use Grammer over Axe for all my non-game projects. How dare you tempt me away from our lord and savior Axe Parser.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on September 03, 2019, 02:21:54 pm
There are perks to both languages, that's for sure. I think Grammer is better for higher-level stuff, and Axe is better for faster, lower level stuff.

EDIT: Here is what the fancy menu looks like now:
(https://i.imgur.com/o6wQiX5.gif)
For this one, each of the items is generated on-the-fly by a Grammer subroutine, and that contributes to it's slowness. It has to execute the subroutine every time the user moves up or down, as well as whenever an element is generated. In this implementation, every time the menu scrolls, it has to generate all of the elements from scratch. I might make it just scroll the contents up or down and generate a single item instead of the whole thing, but that's for future work. At least Grammer already has code for shifting rectangular regions of the screen up or down!.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on September 05, 2019, 08:16:30 pm
Minor update to the above.
The menu routine is now more efficient on scrolling. I did actually take advantage of the "rectangle shift up/down" routines so now it makes fewer calls to the Grammer routines, improving performance.
Here is what it looks like now:
(https://i.imgur.com/t30kDBe.gif)

I also remade the rectangle routines. It is 112 bytes larger, but it is cleaner code, uses 4 bytes of already allocated RAM instead of 24 bytes of specially allocated RAM, and doesn't use shadow registers (so it doesn't need to disable interrupts). As well, I added two new methods-- they both invert the border, but one clears the inside, the other sets it to black. I have no idea why that might ever be desirable, but I have all the other methods of setting the border and fill to black/white/clear/invert, so why not? (and it didn't add much to the code). Now I just need to add in left/right rectangle shifts and world domination will be mine.

Attached is the .8xk for those who need the latest.
Title: Re: Grammer 2-The APP
Post by: Xeda112358 on September 13, 2019, 08:14:30 pm
Hey folks, have the first official update (https://www.omnimaga.org/grammer/latest-grammer-updates/msg407211/#msg407211) in over seven years!
Since the last update, I've optimized some more and added in filled circle routines internally. With that, there are now 12 circle drawing methods, with various borders and fills (between white/black/invert/clear).
(https://i.imgur.com/h3jogwD.png)


Download (https://www.omnimaga.org/grammer/latest-grammer-updates/?action=dlattach;attach=25389) Grammer v2.50.6.3 :)