Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: AngelFish on August 15, 2010, 03:42:45 am

Title: Axe Compiler troubles
Post by: AngelFish on August 15, 2010, 03:42:45 am
I'm extremely new to Axe, so this is probably just User error, but for me, Axe doesn't appear to want to compile programs. I copied an extremely simple sprite control from the documentation PDF to get a feel for how the language worked without accidentally destroying my RAM. When I tried to compile it in Axe 0.4.3, it gave me a File name error. Looking at the list of errors, supposedly I designated the compiled program as the source. However, I was never given the opportunity to designate any program names for the compiled code.

And just for reference, here's the code:

Code: [Select]
:.Steel A Parser
:[3C7EDBFFBDDB663C]→Pic1
:For(A,0,19)
:rand^88→{A+L1}
:rand^54→{A+L2}
:End
:For(A,0,19)
:Pt-On({A+L1},{A+L2},Pic1)
:End
:DispGraph

In all likelihood, any help will be a "duh" moment. But thanks.

Ps: I did search the forum for similar topics, but I didn't see any.
Title: Re: Axe Compiler troubles
Post by: Builderboy on August 15, 2010, 04:05:56 am
The problem is your header, the

Code: [Select]
.Steel A Parser
Line.  What is after the period is what the parser is trying to create your compiled program as, and so it needs to be 8 characters or shorter (also try to use all and only uppercase letters).  Seems like the error documentation is slightly off.  Try changing it so something just like

Code: [Select]
.AXE or .THEGAME
and it should work.  Also, any future bug reports or problems should be posted in the bug reports topic, just so you know :)
Title: Re: Axe Compiler troubles
Post by: DJ Omnimaga on August 15, 2010, 07:29:00 am
You can put additional stuff after the name, though. Example, you could have

Code: [Select]
.AXE The GameAnd if you compile for MirageOS or Ion, the stuff after .AXE would show as the file description in there.

Also welcome to the forums (and the world of Axe programming)
Title: Re: Axe Compiler troubles
Post by: Raylin on August 15, 2010, 09:08:08 am
^ THIS.

Since the problem was solved, the best thing I can say is...

Welcome to Omnimaga. :D
Title: Re: Axe Compiler troubles
Post by: AngelFish on August 15, 2010, 03:21:05 pm
Thanks. That fixed the name problem, although apparently I got my arguments wrong. BASIC-like Syntax would be a good description of Axe from what I've seen. It behaves nothing like the TI-BASIC I'm familiar with. Disp Var gives a lot of weird scrolling text in symbols I've never seen on the calculator before.

And I'll be sure to post in the Bugs thread next time. I must have missed it.
Title: Re: Axe Compiler troubles
Post by: FinaleTI on August 15, 2010, 03:34:59 pm
For your Disp problem, put a >Dec after the Disp Var. It's the first option in the MATH menu. Using >Dec displays the pointer as a number, >Char displays it as a character and >Tok diplays it as a token. If you don't put a modifier like that after Disp Var, it will attempt to display it as a string. If you're trying to display a number, there won't be a string, so it'll just output a bunch of garbage, which should be your problem.
Title: Re: Axe Compiler troubles
Post by: AngelFish on August 15, 2010, 06:01:02 pm
I noticed the >Dec in the Documentation after I posted that, but thanks. Does anyone happen to know of a good tutorial on Axe with things like user interaction, such as an Axe equivalent of the Input() command in BASIC? Even getting the Pxl-On command to work would be great. Just Pxl-On(x, y) doesn't appear to draw anything on the screen, although that's likely because I'm confused by the whole buffers concept.
Title: Re: Axe Compiler troubles
Post by: Runer112 on August 15, 2010, 06:13:36 pm
The best place to start is the official documentation that comes with Axe. I realize normally everybody just says screw lengthy documentations and doesn't bother with it, but it gives a very good introduction to the basics of Axe. It is well-suited for programmers who are used to TI-BASIC. Although it may look long and hard to read, it isn't all that difficult. Just read it, and trust me, stuff will make a lot more sense. (Maybe not complete sense, but a lot more)
Title: Re: Axe Compiler troubles
Post by: Ikkerens on August 15, 2010, 06:14:29 pm
Pxl-On/Off is for sprites (see docu)
Use Pt-On/Off instead
Title: Re: Axe Compiler troubles
Post by: FinaleTI on August 15, 2010, 06:21:04 pm
Pxl-On/Off is for sprites (see docu)
Use Pt-On/Off instead
No, he had it right. He probably just forgot a DispGraph after the Pxl-On(x,y).
Title: Re: Axe Compiler troubles
Post by: Ikkerens on August 15, 2010, 06:33:13 pm
Oh wait yeh.... was confused :)
Sorry about that...
Title: Re: Axe Compiler troubles
Post by: AngelFish on August 15, 2010, 06:44:02 pm
[Facepalm]

Another "Duh" moment. I guess I had assumed it was like TI-BASIC and graph instructions brought up the graph screen.

Title: Re: Axe Compiler troubles
Post by: Happybobjr on August 15, 2010, 06:53:38 pm
the FIX command is extremely useful, if used right, you won't need to have dispgraph over and over again.  (i probably am wrong.)

and welcome. Warning: stay away from Moria, we are afraid of trolls
(http://4.bp.blogspot.com/_iY2zZIXlVBE/TDAr-99GJyI/AAAAAAAAB5A/Bkty9vgtoyw/s400/Cave+troll.jpg)

(lord of the rings)
Title: Re: Axe Compiler troubles
Post by: DJ Omnimaga on August 15, 2010, 08:10:25 pm
I noticed the >Dec in the Documentation after I posted that, but thanks. Does anyone happen to know of a good tutorial on Axe with things like user interaction, such as an Axe equivalent of the Input() command in BASIC? Even getting the Pxl-On command to work would be great. Just Pxl-On(x, y) doesn't appear to draw anything on the screen, although that's likely because I'm confused by the whole buffers concept.
In Axe (and z80 assembly), stuff is not drawn on the screen automatically, with the exception of a few things, like Output() and Bitmap()/Tangent(). It is stored inside a memory area on the calculator and you need to use the DispGraph command to update the LCD. It was done this way because the LCD driver is very slow, so updating the LCD everytime something new is displayed would be very slow. Also keep in mind Pxl-On( and Text( are X,Y, not Y,X.

In overall the graphic functions and variable storage of Axe are similar to BASIC, but some stuff, while being a bit similar, is different. The language was done so it is easier for BASIC programmers, though, so they don't have to learn a totally new language syntax from the very beginning.
Title: Re: Axe Compiler troubles
Post by: Quigibo on August 15, 2010, 08:53:35 pm
Hey, I'm back from a vacation and just noticed this topic.  For your first question, the compiler ignores lowercase letters (unless you're compiling as an app) since program names can not have any lowercase letters.  Instead it will count that as part of the description.  So you were compiling the program "S" with description "teel A Parser" so my guess is that your source code file was also program "S".

The Axe language in general has very high similarity to both Assembly and Basic, so a strong background in either one will definitely help with programming.  An assembly tutorial will have some very useful information for you about how some things actually work and a Basic tutorial would help with program flow since the syntax is similar, however the optimizations are completely different and hardly any basic "tricks" can actually be carried over.  What programming languages do you have a background in?

Reading the entire commands list as well as the documentation should be enough to get started.  Some gaps can be filled with trial and error, other specific things feel free to ask in this forum, that's the primary purpose of it since there are no complete tutorials currently.
Title: Re: Axe Compiler troubles
Post by: Happybobjr on August 15, 2010, 08:54:03 pm
has anyone made an input routine though?
Title: Re: Axe Compiler troubles
Post by: AngelFish on August 15, 2010, 10:17:38 pm

The Axe language in general has very high similarity to both Assembly and Basic, so a strong background in either one will definitely help with programming.  An assembly tutorial will have some very useful information for you about how some things actually work and a Basic tutorial would help with program flow since the syntax is similar, however the optimizations are completely different and hardly any basic "tricks" can actually be carried over.  What programming languages do you have a background in?

I have a background in some Python, and TI-BASIC with a little bit of experience in other languages. The language I'm most familiar with would definitely be TI-BASIC though. However, I wouldn't say I'm anything more than passable in any computer languages.

Just [another] quick question: How do you do grayscale in Axe?
Title: Re: Axe Compiler troubles
Post by: nemo on August 15, 2010, 10:46:04 pm
has anyone made an input routine though?

Yes (http://ourl.ca/6581)
Title: Re: Axe Compiler troubles
Post by: Builderboy on August 16, 2010, 12:25:55 am
Just [another] quick question: How do you do grayscale in Axe?

That doesn't have a quick answer, but let me try to go over it briefly.  So when you draw graphics, you normally draw them to the Buffer.  To update the screen, you GispGraph, which copies the Buffer onto the screen.  In order to do greyscale graphics, you need more than one buffer however.  Drawing greyscale requires 2 buffers, the main Buffer, and the BackBuffer.  You can draw to the backbuffer by adding the Polar Token r after most graphics commands (accessible under [2nd] [Angle]).  And instead of updating the screen with Dispgraph, you update it with DispGraphr for 3shade greyscale, and DispGraphrr for 4 shade.  The commands work like this:

Code: [Select]
DispGraphr:
Buffer        BackBuffer        Color

0             0                 White
0             1                 Grey
1             0                 Black
1             1                 Black

Code: [Select]
DispGraphrr:
Buffer        BackBuffer        Color

0             0                 White
0             1                 Light Grey
1             0                 Dark Grey
1             1                 Black

So for example if you turn a pixel on the BackBuffer, and you clear a pixel on the main Buffer, then use DispGraphrr, it will display a light grey pattern to the screen.  One final note, is that you need to keep using DispGraphr or DispGraphrr repeatedly for as long as you want the screen to have different colors, if you stop, it will just look checkery and weird.
Title: Re: Axe Compiler troubles
Post by: Munchor on January 08, 2011, 08:49:27 am
I thought I'd just use this post for this doubt... I tried drawing a 8*8 sprite in the back buffer, using Pt-On(X,Y,PIC)r.

Well, it doesn't give me any error, but nothing shows up... Any idea?
Title: Re: Axe Compiler troubles
Post by: FinaleTI on January 08, 2011, 10:05:10 am
Did you use DispGraphr or DispGraphrr? Because DispGraph only displays the main buffer (L6).
Title: Re: Axe Compiler troubles
Post by: Happybobjr on January 08, 2011, 01:26:29 pm
If you have a ti-84+SE (a newer one) and axe 4.7  It might be an axe issue that i am also having.

but most likely, it is what FinaleTI said.
Title: Re: Axe Compiler troubles
Post by: Munchor on January 10, 2011, 03:55:32 pm
Yeah, it was what FinaleTI said XD