I've seen a lot of talk about Axe and seen a couple examples of it and would like to try it out. I have a mac though so i was wondering if someone could fill me in on if/how I can head over to the library with my calc and cord and get axe on my calc that way.
First, you will want either TiLP or TI-Connect.
Next, you will want Axe Parser. The latest version can be found here. If there are more posts following, then those are newer versions :)
Then, transfer the Axe.8xk using either TI-Connect or TiLP to your calc and you are ready to go :)
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Thanks! I have Ti-Connect on my computer but the current version does not work with the latest Mac OS versions. Does TiLP work for the Mac? Maybe I'll just get a hold of a friend's computer.
Also how different is the axe syntax from that of basic? I've read some things saying it's very similar and some saying it's got a large learning curve
The first two links were great thanks a lot. But the third one did not work. Is that just me or did something go wrong there?
No, that has been down for a few days now (I tried earlier). I hope Eeems fixes it soon D:
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Axe has some very key differences to TI-BASIC, but it is generally not that difficult to learn. A bunch of commands remain similar to TI-BASIC, but there are also a bunch of things that cannot be found in TI-BASIC.
For example, to draw a bunch of circles:
.CIRC
For(A,1,32
Circle(48,32,A
DispGraph ;Needed for updating the graph screen.
End

Z80 Assembly>English>TI-BASIC>Python>French>C>0
Hmmm after reading the tutorial I think the hardest thing to get a hold of will be the whole pointer aspect. I'm so used to Basic doing all that for me lol. Still should be worth learning, I love the speed. Are you good with Axe?
Pointers are pretty easy once you understand what things like {I+L1} actually do (and it's not hard to explain, either*). Otherwise it's nearly identical to BASIC (minus the whole native floating-point number support and a number limit of 65535 [at least I'm 90% sure that's the limit], but there's always a way around that).
*I decided I'll explain it. If you know how to do pointers, then just don't read this ;)
Say you're using L1 in a BASIC program. Say it has 768 elements. Well then, you'd be in luck because that's exactly how many elements L1 has in Axe! Now, in your BASIC program, if you wanted to get or set an index value, you would do something like L1(5)->A or A->L1(5). The way to do this is fairly similar in Axe. All you would need to do is {5+L1}->A or A->{5+L1}. That's it! Keep in mind, though, that you will be limited to values between 0 and 255 unless you include the Radian symbol (2ND+APPS+3). If you do include this, you can use values between 0 and 65535, like so: {5+L1}^r->A.
The same goes for strings, sprites, GDBs, AppVars, etc. Let's go over an example of a string (though, this is also in the documentation). Say you have "HELLO WORLD" in Str1. This would give you indices 0 to 10, with H at 0, E at 1, etc. If you did something like Disp 5+Str1, the output would be " WORLD" (the space is included). Now, if you only wanted the character at 5+Str1, all you would need to do is {5+Str1}>Char. Now, the output for that would just be the space. Doing something like 5+Str1 basically says "Give me everything in Str1 after, and including, index 5 (in this case, the space onwards)."
I'll give you one more example; AppVars. Let me give you some code with comments. (Note: the code is unoptimized so it's easier to explain.)
.APVTEST
GetCalc("appvTEST")->P // Store the start location of the AppVar "TEST" i.e. where its data begins
If P=0 // If the AppVar does not exist,
GetCalc("appvTest",32)->P // Create the AppVar and give it 32 indices, or bytes of memory
End
For(I,0,31) // For every index in our AppVar (0 - [indices - 1])
rand^10+1->{I+P} // Give said index a random value between 1 and 10 where P is the pointer, and I is the offset
End
// Now, for shiggles, let's display the first 5 indices of the AppVar
ClrHome // Does the same exact thing as BASIC's ClrHome
For(I,0,4) // For the indices we want
Disp {I+P}>Dec,i // Display the index's value (where I is the index) on a new line ("i" is imaginary i and means "new line" when displaying)
End
I feel like I skipped a lot, but I hope I gave a general enough explanation to make sense lol.
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
WOW thank you so much. That was far more helpful than anything else I've read. I'm just wondering though. Nobody has touched on real variables so I'm assuming they remain the same. Meaning you could do 5->A and there would be no errors?
If {5+Str1} gives you everything after 5 how would you get everything before 5?
Is appv a command…?
Whats up with rand^10+1
Can you tell me a bit about sprites?
Thanks so much again. If my questions are annoying you don't have to answer them, I can look it up. I just liked the way you explained things.
Yep, you can do that with the vars :) As a heads up, though, A is not a real variable the same way as in BASIC. For example, if you do 5→A in an Axe program, it doesn't store to the actual OS var. As for the next question, I don't think Axe has a way to get everything before it, so you will just have to use two strings.
Axe changes the tokens while you are editing an Axe program (run Axe, then when you make an axe program, certain tokens will be changed). In this case, [2nd][7], the "v" token gets changed to read as "appv".
rand^10+1 can be broken down like this:
rand creates a random integer from 0 to 65535
^10 will return the base 10 modulus of that number (divide the number by 10 and return the remainder).
+1 adds one :)
So pretty much, he is getting a random integer from 1 to 10.
Sprites… I will leave alone for now, if somebody else wants to pick up here, go ahead! :3
Now here is some fun info: When using data like strings or sprite data, you can use the string and picture tokens instead of the "real vars." Doing this is actually a tiny bit faster and a few bytes smaller for the end program. You can also tack on an extra number or letter. For example, "HELLO"→Str1A. Now this might warp your mind a bit, but here is some more technical info:
Because Axe programs are compiled, not all BASIC optimisations have any bearing in Axe. For example, whether or not you close your parentheses or quotes in Axe, the compiled code will be the same size. Also, all strings, sprites, and other data are stored in your actual code, so when you do "HELLO→Str1, it is not storing to Str1. Str1 is just a pointer that can be used for the rest of the program pointing to the string. For static data (data that is built in and won't move anywhere), using Str1, GDB1, Pic1, etcetera is slightly faster. Since you can use things like Str1D, you have access to as many strings as you want in most practical circumstances :)
EDIT: Also, there are some crazy optimisations you can do for speed and size. For example, the rand^10+1 is more optimised than 1+rand^10. Weird, huh? Well here is how it is broken down in assembly (more technical stuff D:)
In assembly, there there is the slower, bigger way to add one (or two or three) and then there is the bazillions times better way. The first way requires you to load the value of 1 to a register (3 bytes, 10 t-states) and then add it (1 byte, 11 t-states). The second is using the handy inc (1 byte, 6 t-states) instructions which increment a register by 1. Subtraction by a constant of 1,2, 3 or 4 has a similar plight except in this case, the optmisation is even better. The dec instruction is the same size and speed as inc, but the slow method is 5 bytes, 29 t-states.
Moral? When adding or subtracting constants, put them at the end of the formula if possible, in almost all cases to save bytes and tstates. (by the way, the calcs can execute >6000000 t-states per second XD)
Z80 Assembly>English>TI-BASIC>Python>French>C>0
I can explain sprites! I'm not sure if it'd be the best explanation, but I'll give it a try lol. (Note: I'm not going to be going over the Bitmap command, but it is quite similar.)
Ok, so, sprites in Axe are almost exactly like other variables (strings, lists, etc.; not A-Z and θ). They just kind of have their own format, for lack of a better description. Sprites are 8 pixels wide by 8 pixels tall. The way you would get the hexadecimal value for said sprite is as follows (you might know this; if not, then anyone who doesn't can read this part):
Imagine you have an 8x8 grid, or matrix. Every value in this grid is 0 or 1, and corresponds to a binary, as well as decimal and hexadecimal, value. A 1 means "turn this pixel on," while a 0 means "turn this pixel off or do nothing," depending on which command you use. For example, a smiley face:
Grid | Binary | Dec | Hex
0 1 1 1 1 1 1 0 | 01111110b | 126 | 7Eh
1 0 0 0 0 0 0 1 | 10000001b | 129 | 81h
1 0 1 0 0 1 0 1 | 10100101b | 165 | A5h
1 0 0 0 0 0 0 1 | 10000001b | 129 | 81h
1 0 1 0 0 1 0 1 | 10100101b | 165 | A5h
1 0 0 1 1 0 0 1 | 10011001b | 153 | 99h
1 0 0 0 0 0 0 1 | 10000001b | 129 | 81h
0 1 1 1 1 1 1 0 | 01111110b | 126 | 7Eh
This gives us our sprite value of [7E81A581A599817E]. To display this in Axe you could just do the following:
.SPRTTST
[7E81A581A599817E]->Pic1
Pt-On(8,8,Pic1)
DispGraph
Pt-On and Pt-Off are used to display sprites onto the buffer, and DispGraph displays this buffer. The only difference between the two is Pt-On makes non-black pixels (zeroes from the binary) transparent, and Pt-Off actually turns them off. One thing to remember about a sprite's hexadecimal value is that every two characters is one byte. I.e. the hex is 16 characters long, but represents 8 bytes. Now, like I said, sprites are exactly like strings, lists, etc. By this I mean {0+Pic1} will return 126, {1+Pic1} returns 129, etc. You can even "chain" sprites together, which is extremely helpful with animations and making tilemaps. For example:
.SPRTTST
[7E81A581A599817E]->Pic1
[FF00FF00FF00FF00]
Pt-On(8,8,Pic1)
Pt-On(8,16,8+Pic1)
DispGraph
This will display our smiley face with black and "white" lines underneath him. However, the second sprite would best be used as another frame in some kind of smiling animation (you can essentially have as many "chained" sprites as you want). Or, if you're just throwing together a quick program and don't feel like navigating all the way to the picture variables, you can just put all your sprites in Pic1 and display them. There's no harm done. Just remember, each sprite is 8 bytes. Therefore, each offset for a desired sprite must be a multiple of 8, unless you want things to get all freaky.
Um… I think I covered everything (or at least the basics) lol. If there's anything I forgot, just ask, or if you know what I forgot, feel free to add :D
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
Thank you so much to both of you haha. I know i've thanked you a bunch but this is cutting down hours of fiddling.
@Xeda So if I do 5->A in an axe program and then quit, A will not equal 5 still?
That token changing thing is awesome.
OK… sorry didn't really follow the explanation. could you define modulus here? ok never mind while I was re-reading it I figured it out. I'm confused though on why ^10 divides by 10. Also how would you get, for example, a random integer from 5-84 or something strange like that?
@BlakPillar GAH! Finally makes sense. Now I guess i'm going to have to learn to convert to binary and hex lol. Anyone got a program that does that? or are you just really good at it by now?
Whats this whole buffer thing…?
Can you still turn on an individual point with the pt-on command or do you need to use pxl-on?
What modulus does is it returns the remainder of a division. So if I "modded" any number between 0 and 65535 by 10, it would give me a number between 0 and 9 (it can't be 10 because 10/10 = 1 so the modulus would technically be 0, and it can't be greater than 10 because then the answer [not remainder] would be higher). Then I just add 1 and BAM! Random number between 1 and 10 :) Basically, an easy formula to get any random number between any range (well… not any range) in Axe is this: rand^(max+1-min)+min. So, to get a random number between 5 and 84, you would just do rand^80+5.
As for getting hexadecimal pictures, that's easy peasy! In the zip folder that Axe is in, there should be a folder called "Tools," and inside that folder there should be another folder called "Sprite Editor." In there is a really handy program for designing 8x8 sprites. The buffer thing isn't really necessary right now. Just know that if you change the screen (by using Pt-On/Pxl-On, etc.), you'll need a DispGraph. When you understand more and want to get into gray-scale, then worry about the different buffers ;)
Pt-On/Pt-Off is for sprites only. Pxl-On/Pxl-Off are for single points. Both have the order (X,Y) in Axe, with the Pt commands having the additional sprite parameter, so (X,Y,SPRITE). If you ever need to know how to use a command, check out the commands HTML file in the Axe download :)
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
It's like you're inside my head… you explain things just the way i understand them.
Got the whole random number thing down now.
Hmmm… didn't put any of the tools on the calc… gonna need my friends computer again. In the mean time I'm gonna write a binary to hex program and draw out my sprites haha
Alright thats kind of what I thought buffers were. You're right I don't want to get into that yet. How many buffers are there though? And thank god they have the same parameters.. never understood why they are different in basic.
Final question… 1. are pt's etc are still affected by window settings? 2. when you display a sprite are the coordinates the top left of the sprite?
Cool, I didn't even know about that sprite editor o.o There are tons of them out there made in Axe, BASIC, Assembly, Celtic, xLIB, you name it, so you will have access to tons of sprite editors o.o Still, learning hex and binary is really cool. The best secret thing that doesn't click at first for a lot of people is that converting binary to hex is super easy and vice versa. It is converting to or from decimal (base 10) that is a pain XD There are plenty of base converters, too, so you should be fine :)
Z80 Assembly>English>TI-BASIC>Python>French>C>0
@Xeda, yeah, after making so many sprites trying to get just the right ones, I can kind of predict what the hex outcome will look like haha. I haven't had the need or patience to mentally be able to convert them yet… My one friend kind of can, though.
@7HQR, awesome! I'm just explaining the things the way I learned them lol. I guess great minds learn alike as well ;) As for buffers, I think there are only 2, but I can be wrong. I didn't really learn all about them yet.
Answers:
- Nope! :D
- Yup!
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
Ooh! I know buffers :D Actually, you can create your own buffers, but there are three main buffers. Think of a buffer as a copy of the graph screen. You can use it for other data as well, but it makes it easier to visualise. The graph screen is one of the buffers, then you have L1 and L3 which point to the other two 768 byte buffers. You may want to use #Realloc(32768) if you are going to use L1, though, but I won't explain that yet.
Axe lets you draw to them, display them, and do whatever, so feel free to play. For example, using Axe v1.1.2 and probably the future ones, to draw a circle to buffer L3 and then display it:
Circle(48,32,10,L3
DispGraph(L3)
To create other buffers, just make an appvar with 768 bytes for each additional buffer you want :)
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Someone fill me in on this whole number system thing? 0-65,000 or whatever.. i'm pretty lost. Like I'm trying to write my first axe program (attempting helicopter lol) but i'm stuck on generating the terrain because i don't know how to create a random number from -1 to 1
Hmm, well here is a quick tip. The 65535 isn't ac16-1, you will notice it is 65535. This is because 65535 is the largest 16-bit number :D As for negatives, here is how you can do that:
rand^3-1
That is all you need :) How does this work? In Axe, -1=65535. If you do 65535+4, for example, you get 65539. Since this overflows 216, you subtract 65536 and you get 3. Essentially, you just did -1+4 :)
16-bit math has some fun tricks o.o
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Definitely not XD But you can kind of simulate fraction precision. For example, say you wanted to make a gravity physics engine. You can do:
0→X→Y→V→W→A
10→B
Repeat getKey(15) ;Exits when Clear is pressed
Circle(X/256+4,Y/256+4,4 ;This is the precision. X and Y increment less than 1 pixel at a time
DispGraph
ClrDraw
V+A→V+X→X
If >22527 ;88*256-1 because 88 pixels
-V-A→V
End ;All If statements require an End
W+B→W+Y→Y
If >14335 ;56*256-1
-W-B→W
End
A+getKey(3)-getKey(2)→C ;A+leftkey-rightkey
If abs(C)<61
C→A
End
B+getKey(1)-getKey(4)→C ;B+downkey-upkey
If abc(C)<61
C→B
End
End
I doubt that helps, but I just wrote the code and it used extra precision, so I figured I could share.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
I used 256 as an arbitrary number (actually, for Axe, dividing by 256 is very fast compared to some other numbers). Anyways, when using /256, you basically get the precision of using decimals. By incrementing the velocity by 10, I am in effect incrementing by 10/256. The +4 is just so that the whole circle is always on screen (it has radius 4, so at (0,0), only the lower right corner of the circle shows).
I don't know if that helps? Also, most of that you would not get unless you programmed it yourself XD I've made similar routines in BASIC and Grammer so many times that I know what the code is supposed to do. (and so I can figure out what is happening pretty easily).
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Ok I think I understood more of that. Could you possibly give me some feedback on this program? I wrote my own little version of helicopter and its decent but it's programmed really messily
.HELICOPTER
DiagnosticOff
5->B:31->C
[007E081C7A0C00]->Pic1
ClrDraw
30->θ:0->Z
-94->S
Repeat getKey(15) or (pxl-Test(10,θ/256)) or (pxl-Test(9,θ/256+6))
Pt-Change(3,θ/256,Pic1
Horizontal -
Line( 94,0,94,B
Line(94,62,94,C
Pt-On(3,θ/256,Pic1
DispGraph
rand^3-1->D
min(40,max(1,B+D))->B
min(61,max(22,C+D))->C
If getKey(4)
Z+2->Z
Else
Z-1->Z
End
θ-Z->θ
S+1->S
End
ClrHome
Disp S▶Dec
This is weird… worked my way up through basic asking stupid questions until I was actually answering those stupid questions for people and now here I am asking stupid questions all over again. Fell off the ladder so to say lol
Actually, the code is pretty good, just so you know o.o There are only two things that I see that I could optimise:
Z-1->Z
Turns into:
Z--
And similarly:
S+1->S
Turns into:
S++
Nice :D
Z80 Assembly>English>TI-BASIC>Python>French>C>0
aha! So many nifty little tricks haha. Ok probably the last question for a little bit… when you use the rotc( command… it returns a pointer to the new rotated sprite correct? How would I then display that?
Lets say I have a sprite and i display it with pt-on(5,5,pic1) and DispGraph. Then lets say I do rotc(pic1). Now how do i display the rotated sprite?
EDIT: Just kidding. not my last question. Working on a shooting game kind of thing and when you shoot a bullet off the screen and wait about 5 seconds it comes back on the other side… also if the "character" or sprite moves in one direction for a while it reappears on the other side as well. Why is that? I put nothing in my code about wrapping
For the first question, you can do rotC(Pic1)→Pic2 and then display it as you would a normal sprite.
As for bullets and whatnot, remember Axe uses only integers 0 to 65535. When it gets to 65535, if it goes up by one more, it wraps back around to 0. For drawing commands, it might wrap at 256, though.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Hmmm so if I wanted to rotate a picture but keep it stored in the same place could I do rotC(Pic1)->Pic2 and then Pic2->Pic1?
Yeah its gotta wrap at 256 I guess, because it would take a really long time to get to 65535
No, when you use rotC(, that is actually a command that doesn't turn into code. That tells Axe while it is compiling to create the sprite data, but flipped.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
I don't know if this is still a concern, but there was a thread about a binary to hex converter not too long ago. That particular one was designed for only 4 binary digits, but modification would be really easy so you could use it for more.
—Wolfgang
I made a paint application that supported 8x8 and 16x16 drawing a while ago, and it had a hexcode generator feature. I don't feel like posting all the code, but I'll give an overview on it and the code for the hexcode generator (using pxl-test()s):
Each point was 3x3, and could be inverted. The center of the top-left one was (with pxl coordinates) at 5,5. When it was a 16x16, X=5, and when it was 8x8, X=4. And here's the code for the hexcode generator:
:DispGraph
:"?→Str1
:For(A,1,8+8(X=5 // each row
:For(B,1,2+2(X=5 // each 4 pt part of the row
:Text(0,58,100((A-1+(B-1)/(2+2(X=5)))/(8+8(X=5 // the percentage complete
:{0
:For(C,4B-3,4B
:augment(Ans,{pxl-Test(3A+2,3C+2
:End
:sub("0123456789ABCDEF",Ans(5)+2Ans(4)+4Ans(3)+8Ans(2)+1,1
:Str1+Ans→Str1
:End
:End
:sub(Str1,2,16+48(X=5→Str1
And the hexcode in Ans or Str1.
That is a good explanation from BlakPilar and might be easier to grasp. Since I knew Assembly before learning Axe, I thought of it this way:
Think of your calcs memory as a huge list of 65536 bytes numbered 0 to 65535. If I wanted to read byte 40000, I would do {40000}. If I want to store that value to a var, I could do {40000}→A. Likewise, if I want to store a number to that byte, 3→{40000}.
You can use pointers and the preset values in Axe to get offsets. For example, L6 points to the graph screen in Axe. L6 is a preset value. Anyways, to access the first byte, do {L6+0} or just {L6}. There are 768 bytes in the graph screen, so the last one is {L6+767}.
Now say you create a var. Axe returns the pointer, so just store that to a var and you can access the memory of the var (using offsets).
To read words (2 bytes which is 16-bits), use the r modifier :) As a technical note, words are stored backwards (little-endian), so if you store the number 3EE0h, it will be stored in memory as E03Eh. However, when you read it, it is also read in reverse, so this is not a problem. It is very useful for arbitrary precision math, and whatnot, but that is not easy stuff XD
Z80 Assembly>English>TI-BASIC>Python>French>C>0
I followed this until I got to "Now say you create a var" hahaha, I don't know any assembly so you lost me there but thank you for the rest of it. I like the way you said to think about it
:D In Axe, to create a variable like appvarRAWR, it is really straight-forward.
GetCalc("appvRAWR",768)
Since that returns a pointer to the data, you can do this instead to save the pointer:
GetCalc("appvRAWR",768)→A
Also, as a note, that creates an appvar with 768 bytes of RAM :)
EDIT: And then if you want to read a byte, say, the second byte, {A+1} :)
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Sorry if this is a dumb question lol. I asked BlakPilar up there but is appv a command? I can't find it if it is.. and if its not why is it lowercase?
2nd+7. While in TI-Basic it's v, there's something in Axe that makes it appear as "appv".
Sunrise 3 Progress: 30%
Size: around 20 KB, not including the save lists and in-game RAM.
What's the fastest/smallest method for pausing until a keypress in Axe? Is Repeat getKey:End the only way to do it?
Yep, that is the smallest way I know of.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
And is there a command that does the BASIC sub()? Not the subprogram sub(), but the one to extract parts of strings.
I just need 1 character (sub(Str1,X,1)).
No, there is not :/ Remember, Axe does not create strings in RAM, it just creates a pointer to the string data in your program. If you need just one character, though, you could do this:
{Str1+X}
If you needed 3 or something, you would be more out of luck.
EDIT: This is also why Axe cannot do string concatenation.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Wow now I'm asking all the questions lol
It's too bad that there's no alternatives to sub(), but for the program I'm making now, I just need 1 character at a time. So I don't mind that - at least not now. But couldn't you use a For( loop routine to do it? I don't think it would be that hard…
But now I have another question: How do you get the number pressed from getKey?
I know this: 26-3int(.1Ans)+10fPart(.1Ans)+2(Ans=102) or something similar to it in BASIC.
But in Axe the getKey codes aren't nicely lined up like that… Will I just have to use a bunch of If or piece-wise statements?
Yeah, you could do the For( trick, I just wish it were simpler XD
And actually, you might be surprised to know that in Axe, getKey codes are actually elegantly set up— you just have to look at it right (look at the columns not including the top two rows of keys). Still, the solution isn't very pretty and if you aren't yet familiar with bit logic this might look tough:
getKey-17→A
If =abs(A
A and 7*3-(A/8)→A
If =0
-2→A ;This is a minus 2, not negative
End
If A=-2 ;This is a negative 2
0→A
End
End
If A>9
-1→A
End
That will return, in A, -1 for all keys that are not a number, otherwise it returns the corresponding key :)
Z80 Assembly>English>TI-BASIC>Python>French>C>0
That looks pretty cool. I actually just made one, but it used 4 extra variables and things outside of the [0-9] keys were weird. I'll use this, but after I ubderstand it.
I don't get that negative part. I thought Axe looped up to 65535 when below 0? Then the abs doesn't make sense, and even if it supported negatives, then the If A>9 wouldn't work. I'm probably missing something obvious :( Is that what you meant by bit logic?
And 'A and 7*3-(A/8)→A' made no sense. Please explain!
EDIT: OK, thanks. I kind of thought that was what abs() would do, but I wasn't sure. The [and] bitwise logic is pretty cool; I checked it out. It was actually pretty nice that the columns were 8 apart. [2nd], [MODE], and [DEL] had to be different, but it worked nicely. Thanks again for the code and explanation.
I checked out bitwise logic and found this. It really helped.
Hehe, the bit logic referred to A and 7. In Axe, and performs bitwise logic, so you need to look at the binary representation of the two. Because 7=00000111b, I am essentially masking out all but the lower 3 bits of A. This tells me how far up the column a key is (0 is 0, 1 is 1, 4 is 2,7 is 3, for example). This is what the number pad looks like where the lower left is the key for 0:
3 3 3
2 2 2
1 1 1
0 0 0
Next, I multiply that by 3 so the keys so far return these numbers:
9 9 9
6 6 6
3 3 3
0 0 0
Now We subtract A/8. You will notice that because I am working with getKey-17, [(-)]=0, [.]=8, [0]=16. This is not a coincidence, this is because of hardware design. So A/8 tells me how far from the right a key is starting at the second column. The map now looks like this:
7 8 9
4 5 6
1 2 3
-2 -1 0
Now it is pretty much what you need, just do some house cleaning. First, change the occurence of 0 to -1 (-1=65536-1=65535, by the way) and then change the occurence of -2 to 0:
7 8 9
4 5 6
1 2 3
0 -1 -2
So -1=65535 and -2=65534. These are both easily greater than 9. Thsi brings us to the next topic :D
Even though we are working from 0 to 65535, we can create artificial negative numbers. All we do is make the lower half of the numbers "positive" and the upper half "negative." abs( will perform 65536-A if A>32767. So look at -1. Since that is 65535, if we do abs(-1, we get 65536-65535=1. Axe lets you do signed and unsigned math, I just used a mix. When I did If A>9, I was testing using the numbers 0 to 65535 as all poisitves.When I did abs(, I treated the upper half of the numbers as negative.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Does this partial negative # supporting mean that the trick where you multiply by -1 to switch between 2 things will work?
W00t!
Well, even then, a very powerful trick that you might use in higher math (think Abstract Algebra) is this:
You are working in Z65536. Z means integers, the subscript 65536 means you are using a mod system. In this case, all integers 0 to 65535. If you multiply anything times 65535 in that set, you will get the negative. This is because in Z65536, -1 very literally is in the same partition as 65535. Likewise, multiplying anything by 65534 will do the same as multiplying by -2. The integers make for a very nice ring structure :3
Also, a partition works like this (also known as a coset). All integers of the form 1+65536n are in the same partition (1,65537,131073…) and the same goes for any 0≤n≤65535. So that means in Z65536, all numbers in the same partition work similarly :) -1 is in the same partition as 65535 :D
Isn't math magical? :3
Z80 Assembly>English>TI-BASIC>Python>French>C>0
getKeyr
Its in the [C:\Users\Karen\AppData\Local\Temp\Temp3_axe1.1.2.zip\Commands.html commands list] in the system section. (not sure that link will work but you donwloaded axe so you should have the commands list)
Alright… may be time to learn a bit about buffers. I made fall down (nice little arcade game where you move back and forth to drop through holes as the screen rises if you didn't know) and it all works fine but I would like to make it display your score as you go. So I had it display the score in the upper left corner but as the screen shifts up so does the score and the screen is updated much to quickly to read it. Would displaying the score on a separate buffer help?
I know very little about Axe, but I know one thing that helps me in BASIC when something updates too quickly to be seen clearly is rearranging the order of the code a bit, so that there are more lines of code that have to be executed after the object or text in question are "turned on" and before they are "turned off".
—Wolfgang
lol yeah I wish I could just do that with this. Problem is the fps is probably not even countable it runs so fast so no matter how it is organized it will be updating multiple times per second…which actually makes me wonder if I can even do this… I'm sure Xeda will no some way
So I used the text command to display a menu but as soon as the program hits dispgraph all the text disappears… is there something I'm missing here?
I am pretty sure you have to set a flag (I think it is a [b]Fix [/b] command) to let you draw to the graph, otherwise it just draws to the LCD. I don't have the documentation on hand at the moment, though -_-'
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Alright thanks, I'll check out the documentation. Didn't even think to look there for some reason.
Funny story. This program allows you to input a value for game speed… and if you put in 0 it does not pause for 0… it pauses for 65535 or whatever haha…. waiting for it to unpause currently
Ouch, yeah, in some cases, 0 is taken as 65536, other times just zero.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
To use the Text command like the regular, BASIC version, you need to put Fix 5 at the top of your program. I only have that memorized because I use it for debugging a lot lol.
As for the Pause thing, yeah, I've made that mistake before and it sucks :/ Maybe you could just do a check to see if the value is not zero beforehand?
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future
OOOHH thank you, I forgot about all those display settings and what not. It all works now thanks. Yeah I just restricted the range for input. I'd really not wait for that whole pause again. It was in a loop so i had to hold down clear until it finished pausing or it would just go again… that was fun
Also is there a good way for erasing lines? With all the graphical wonders of axe I'm surprised there is no option to draw a white line.
Unfortunately, despite much request, there is no direct way to erase lines :( The best alternative currently is to invert the screen, use Line() to "erase" any lines you want to erase, and then invert it back
hmmm I am very surprised about that… hopefully it's in the next update. So you would do something like DrawInv:Line(X1,Y1,X2,Y2):DrawInv?
On a side note I just downloaded your game Vortex the other day (brilliant game btw) and went into the source code just to check it out and stumbled across the little secret… so i played a couple of my friends and they were wondering how i got all the way across the board in one turn and placed traps on all sides of them haha
Yep, that is the code to use to draw the line inverted :) Also, Axe doesn't have it in because it would add to the size of the routine or slow it down (or both). If he made it a separate routine, it would be about as fast, but laarger. if he made an all-purpose routine, it would require some extra bytes and slow the drawing down (it probably wouldn't be too noticeable until a few hundred draws, though).
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Isn't Axe compiled?
Sunrise 3 Progress: 30%
Size: around 20 KB, not including the save lists and in-game RAM.
Yes it is :)
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Then why would adding line-erasing features in slow the routine down?
Sunrise 3 Progress: 30%
Size: around 20 KB, not including the save lists and in-game RAM.
Because it depends on how you implement it. Add extra code to make the line drawing generalised or make another routine completely that will be just as fast but make the program larger a bit larger (well, about 149 bytes larger).
Z80 Assembly>English>TI-BASIC>Python>French>C>0
1. Can you do live multi-calc games in axe? I noticed the get command doesn't wait and the send command will only wait for a set amount of time so I'm interested.
2. What would be a good way to check if a connection is made in the first place? This is what I have but it doesn't work and I'm not positive why.
Disp "(1)HOST",i,"(2)JOIN"
Repeat getKey
End
If getKey(26)
Repeat Ans≠0
Send(5,100)
End
End
If getKey(34)
Repeat Ans=5
Get
End
End
ClrHome
Disp "CONNECTION MADE"
Ans does not behave the same way as it does in Basic. When you say 'Ans' in Axe, it is simply a way to read and write to the Basic Ans variable. It does not take the value of the most recent expression, and it is actually quite slow.
oooh ok, thats helpfull.
Disp "(1)HOST",i,"(2)JOIN"
Repeat getKey
End
If getKey(26)
Repeat Z≠0
Send(5,100)->Z
End
End
If getKey(34)
Repeat Z=5
Get->Z
End
End
ClrHome
Disp "CONNECTION MADE"
Will that work?
Yep! You could even do something like:
Repeat Send(5,100)
End
and
Repeat Get≠5
End
There is actually no need to store them to a variable, you can put the commands right in the loop argument!
I made a little gravity engine in Axe, but it isn't working. I set it so that it would fall whenever there was no pixel below it - but it just keeps falling! Here's the code simplified down to my problem:
:31→A
:Repeat A≥54 or getKey(15)
:RectI(4,A-1,3,3)
:If not(pxl-Test(5,A+2)) // I tried (5,A+3) too
:A++
:End
:Rect(4,A-1,3,3)
:DispGraph
:End
It should stop falling when there's pixel on underneath it, but somehow it just erases the stuff under it and keeps falling. Does anyone know why?
Have you tried (5,A+1) in Line 4?
Sunrise 3 Progress: 30%
Size: around 20 KB, not including the save lists and in-game RAM.
Just tried it - doesn't work. :(
BTW, I don't think that would have worked because of the line: RectI(4,A-1,3,3)
{5,A} is the center of the object, and it is 3x3 pxls. So it had to be {5,A+2} to be right underneath the object, as the entire object is being erased and {5,A+1} will always be off as it is part of the rectangle.
And I just had a thought - does RectI(4,A-1,3,3) somehow erase the pixels below it (specifically {5,A+2} and {5,A+3})? That might be the problem…
What version are you using?
Sunrise 3 Progress: 30%
Size: around 20 KB, not including the save lists and in-game RAM.
Another question regarding Axe:
How do you display both the main buffer and the back buffer at the same time? I've tried using DispGraphrr, but the back buffer just kind of flashes, and the main buffer appears gray. I don't want grayscale, I just want to display them both together as one screen.
I can't make it all on one screen. I need to pixel check separately on each of the buffers. So I need to display both the main buffer and the back buffer as one, and not as grayscale, all while keeping the two separate buffers.
How can I do that?
EDIT: I tried DispGraphr and it worked - there doesn't seem to be any gray now.
EDIT EDIT: Now strange pixels keep appearing at the very top row of pixels… Strange thing, though. Every time I compile it, then run it, it goes away. After the 1st run after the compile, the pixels return… ?????
If you want, I can post a screenie.
EDIT EDIT EDIT: No, I can't post a screenie. This glitch only happens on my TI 84+ SE, it won't work on my TI 84+ SE emulator (using the new Tilem 2).
Hello. Though this thread seems to be death, I want to try my luck :)
I read all stuff on this page, something more, other less carefully. I also liked the way everything was explained :)
Ok so now, after two years, my load of questions:
I need to do something like
:31>Char-> Ans
But that throws an error.
Also i have read many things about creating an appvar but how can I store some text in it???
Await more questions…
EDIT: So basically my problem is in storing text…
Hey hopefully you can read this post, I have also read like you.
For that error you have ans doesn't really work like it does in basic.
I may be wrong because I am still fairly new with Axe but I was wondering if you could help me.
Im using List 1 and i need to delete some coordinants when the pixels go off the screen. I plan on using pointers but I don't really know how.
If you could help that would be great, if you showed me more of your program I think I would be able to help more.