Omnimaga
Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: Quigibo on March 28, 2011, 07:04:01 pm
-
This is the place to make requests for specific assembly commands you might need in your Axe programs as well as to show off or improve existing Axioms. In case you're not familiar with the lingo, Axioms are assembly libraries that extend the Axe language. They can be linked into your Axe programs by using the command: #Axiom(AXIOMNAME). To write your own Axioms, check out the AxiomSDK in the "Tools" folder of the latest version of Axe Parser (assembly knowledge required!).
As another feature of this thread. I have more space for custom Axiom tokens. If you can think of some token names which have no near-substitutes and are general enough for many possible uses, I will definitely consider adding them.
Here is a list of current Axioms (mods, please update):
LCDKit: (http://ourl.ca/9952/190823) Control many features of the LCD screen - By Runer112
Pucrunch: (http://ourl.ca/9960/190945) Efficiently Compress/Decompress your program data - By Iambian
Crabcake: (http://www.omnimaga.org/index.php?action=dlattach;topic=7373.0;attach=7891) Allows you to turn your Axe program into a larger-than-8-KB ASM program - By Hot_Dog
SpeedKey: (http://ourl.ca/11151) Optimized Getkey for just the arrows - By Binder News
Aiming Utility: (http://ourl.ca/14229) Returns an angle that can be used to aim at targets given a delta X and Y - By Iambian
-
There has been conversation about advanced graphics features, such as floodfill (with grayscale support) and masked LCD sprite display, which could probably make a fairly decent Axiom. Though masked LCD sprite display would probably go better in Runer112's LCDKit, and he was talking about doing it eventually anyway.
-
Something that would allow the font to be edited on-calc.
-
That would be nice. Large or small font? Or both? I guess an axiom could include routines for both...
-
Pucrunch: (http://ourl.ca/9960/190945) Efficiently Compress/Decompress your program data - By Iambian
Wait, I thought it could only decompress...???
-
It includes compression tools.
-
Ok I guess that's what I get for only reading the first page :P
-
Graphscreen input with custom coordinates, allow/disallow lowercase, max length, word wrap, and custom prompt would be kickass. Something like gInput(x,y,[0 for no lowercase, 1 to allow],[max length],["prompt" or Str# to use as prompt]
-
An elaborate drawing Axiom would be nice, with:
Lines
Circles
Rectangles
FloodFill
Lines circles and Rectangles would all have draw, clear and invert modes, possibly with a numerical argument instead of multiple r's. Recangle and Circle would also have options to fill black, fill white, or fill invert. FloodFill would have to be limited to fillBlack or FillWhite, as fillInvert doesn't make much sense :P
And all of the commands would be able to be drawn onto the front, back, or both buffers.
-
FloodInvert makes sense iff the target image has two colors.
-
ooooh i see what you mean, yeah I guess that could work :P
-
Some way to prevent access to the Catalogue during input or have char input instead of tokens. Also, perhaps a token editor, too?
-
Graphscreen input with custom coordinates, allow/disallow lowercase, max length, word wrap, and custom prompt would be kickass. Something like gInput(x,y,[0 for no lowercase, 1 to allow],[max length],["prompt" or Str# to use as prompt]
That sounds like a fantastic idea!
Maybe it could also have support for character sets. Like...a pointer to the starting address of a 16 byte character set.
It would be really nice if Axiom commands could support optional parameters. Maybe the header could have something like one byte for "# of arguments expected" followed by one byte for "# of optional arguments." Then it would have another byte somewhere that is set each time the axiom is called containing the number of optional arguments supplied. I know that's complex, but I think it could end up being useful. Though it would add an extra 2 bytes per routine to your Axiom.
Ehh, just a thought.
-
I really need to learn Asm.
-
CalcNet and gCn Axioms would be super-fantastic.
-
Hooks Axiom would be fair too :)
And also a better linking routine, that we could use with USB port.
-
Axiom that lets you play stereo sound.
-
Axiom that supports USB sound.
-
CalcNet and gCn Axioms would be super-fantastic.
And they aren't very hard, either. It's just a few subroutines and a few memory addresses. I could probably write one in my spare time. And gCn uses the same commands as CALCnet.
Axiom that supports USB sound.
Or USB input (like a mouse or flash drive).
-
an axiom for drawing triangles and quadrilaterals would be nice. I already tried, but I failed miserably.
EDIT: one triangle was drawn every .4 seconds... :P fail.
-
a gCn Axiom will definitively be really great.
-
How about some more advanced string operations?
-
How about some more advanced string operations?
There are a few Axe-made subroutines good enough for the job.
I guess... Why use ASM, which is harder to deal with strings than Axe to help Axe dealing with strings? :P
-
Inverse trig operators.
And accurate trig routines that behave like decimals. ie; the axiom would take both a multiplier as well as an angle as input and output the correct fraction of the first argument: sin(2000,45) would return 1414 for example.
And 32 or 24 bit math operators that return values in 16 bit formats. (So you can calculate sqrt of 340^2+24^2 for example without running into overflow corruption)
-
For accurate trig functions you'll pretty much have to turn to a LUT. The only reason sine and cosine routines exist is because they have a limited range and can be somewhat accurately approximated by a quadratic function. And by somewhat accurate, I mean errors reaching 10%. Trying to model just about any other trigonometric function with a simple model would probably result in wild amounts of error, and trying to model them with a more complex model would probably end up being larger than a LUT-based solution anyway. Unless you need a variable argument for your scale factor, it's best to just use a custom pre-computed LUT.
-
LUT? What's that?
An Axiom for custom size sprites would be awesome.
-
LUT = Look-Up Table. In this case a bunch of precalculated values for the trig functions to save on calculation speed and size.
-
Isn't that just a regular table, though? Also, how exactly does the calc display tokens? Am I right in thinking that it's a big table of strings somewhere?
Oh, and a quaternion math Axiom would enable 3D rotation without gimbal lock.
-
Mouse and keyboard support.
-
Mouse and keyboard support.
You mean through USB? Now that would be cool.
Quigibo, would you please modify the first post to have a list of requested Axioms? That way everyone could see them, and they'd all be in one place.
-
Mouse would be nice. I think there could be the option to use the Doors CS7 mouse or a standalone routine maybe. However keep in mind not everyone wants to buy an adapter to connect their mouse to the mini-USB port, so such program would require that arrow keys and two keypad buttons can alternatively be used if no mouse is connected.
-
I have one: Multiple Buffer Suppert. Meaning, you can have two, three, or four Graph screen buffers, with diff. symbols for each, and different DispGraphs draw different ones to the screen. Also, you could OR one buffer over the other when displaying. This would be soooo useful.
I'm thinking this removes greyscale, so,
Dispgraph = Buffer 1
Dispgraphr = buffer2
DispGraph(Degree symbol0 = Buffer Three
DispGraph' = Buffer 4
And so on, applied for all the drawing commands (including Line, preferably)
-
Where would the memory for the 4th buffer come from?
-
I don't know :P RAM pages? There's tons of space there, right?
-
Yeah, but you have to swap into it, after which you lose the other 3 buffers :P
-
But a Buffer takes 768 bytes. A Ram page has 8000, right? That's 10 buffers with a few bytes of breathing room, if I did my multiplication right :P
Also another request: Partial screen updates for more speed. As in, specify update a rect from 0,0 to 10,10, only changing 100 pixels, instead of the whole screen.
-
True, but where is your program? It was in the *other* ram, the one you just swapped out of :P now you have 10 buffers and no code! :D
-
- grayscale package for cleanly displaying 3,4,5,6,7 and 8 level grayscale based on 2-3 buffers
- quick RLE compressor/decompressor (different from pucrunch due to a smaller size and faster speed)
- I'll second stereo sound
- OOP control axiom
-
How could you use OOP in an Axiom?
-
I'm sure there are ways ;) I had a system pseudo coded out, but I gave it up because it would be a bit hard to make in assembly. But, if no one else makes it, maybe I can later on ;)
-
@BuilderBoy That's why your routines fit in the other half of the RAM not taken by the four buffers, and return you like a subroutine when finished. :P
@AshBad with the newer dispgraph, 7 level is easy enough. swap between 0 and 1 (4 lvl) every frame for one between them. It doesn't look half bad, either! same for 1 and 2, 2 and 3. It looked hideous before 0.5.1, but now it's pretty decent.
-
Will, but what I mean is that as soon as you access the second page of Ram, every part of your program is gone, because its in a different Ram sector that you don't have access to anymore
-
Though, I think an assembly version would look better ;)
To tell the truth, 5-7 level grayscale is extremely similar to 8 level :)
-
So, how does one use it in a program? seems like there must be some way to switch back and forth....
@Ashbad, sure, but try it! 3 transitions to 5 the same way :P 8 is harder though.
-
Im no expert, but I believe you have to be executing from the OS, or from an App in order to control the swapping of RAM pages and still have it be useful. But anybody feel free to correct me :)
-
so....app-only axiom? that's not really a problem for me.
-
Hmmmm it could work, how about it just lets you supply a pointer to the buffer and the programmer can figure out where to get his RAM :P
-
It's a thought. You get 8000 bytes for the prog, without any L* messing around, right? That might be enough if I use appvars for map data.....
What? I didn't say anything! :-X
-
Indeed ^^ I wonder if 16 scale greyscale would be fast enough with 4 sprites to display per object to get good speed though o.O
-
I wasn't wanting it for greyscale. I wanted it for overlays, basically ORing one buffer to another, for a secret project I'm working on. But I don't want either buffer corrupted.
-
Oooooooh in that case we don'y need to bother with this because there is enough memory in L1 L3 and L6 for 3 buffers :) I imagine that Axiom would be fairly easy to make too! :D
-
Yay! Now I can has my 3 buffers! that's enough for me. I really only need two, but who knows, I might need three later :P
-
Oooooooh in that case we don'y need to bother with this because there is enough memory in L1 L3 and L6 for 3 buffers :) I imagine that Axiom would be fairly easy to make too! :D
You can actually do all of the sprite commands to any external buffer by using Pt-Command→BUFF. If you need to use one of the L6-only commands, you can also use Exch() (expr() in the Catalog) to swap your buffer into L6.
-
I didn't say you couldn't? What do you mean? I just meant we don't have to allocate any new memory to get 3 buffers :)
-
@Compy Is there a way to OR two buffers together? Also, does that work for DispGraph?
-
There is definitely a way to do it in Asm, although you would have to get an asm guru to help you, I am not leet enough :P
-
Hence the axiom request I guess. :P So, I need a way to do bitwise-ORs for entire buffers :P
Also, how do you address the sprites put in as a tilemap using [PICr]? I figured I might as well ask.
-
@Compy Is there a way to OR two buffers together? Also, does that work for DispGraph?
Not easily. You will have to OR each byte in turn. However, you can store that directly to the LCD by using Runer112's LCDKit:
For(I,0,767
{I+L3} or {I+L6}→imag(I
End
-
umm, shouldn't it be a +, since or is only 8-bit?
From manual,
EXP1·EXP2
EXP1+EXP2
EXP1☐EXP2 Returns respectively the full 16 bit "and", "or", and "xor" of the two expressions. These are the plot style tokens.
-
umm, shouldn't it be a +, since or is only 8-bit?
From manual,
EXP1·EXP2
EXP1+EXP2
EXP1☐EXP2 Returns respectively the full 16 bit "and", "or", and "xor" of the two expressions. These are the plot style tokens.
You mean like the small + one, right? Personally I've never used that. Thanks for the example for where it would be good to use it xD
-
Well, he's using only one byte at a time anyway, so its perfectly fine and more optimized to just do the 8 bit operation. You could "or" the screen 2 bytes at a time too, but I'm not sure which way would be faster.
-
umm, shouldn't it be a +, since or is only 8-bit?
From manual,
EXP1·EXP2
EXP1+EXP2
EXP1☐EXP2 Returns respectively the full 16 bit "and", "or", and "xor" of the two expressions. These are the plot style tokens.
Well since he is going byte by bytes (For(I,0,767)) the 16bit isn't needed :)
-
oh good. I can use it then!
-
Those are commands? I didn't know that.
-
Oh, and just to clarify, if you want a fourth buffer, all you have to do is add a Zeros(768)->Name and then reference that name instead of L6/L3/L1 to use that buffer. :)
I second (third) the stereo sound Axiom request. :D
-
Also, I figured out a better way to do it anyways :P now I only need the original two, and I get free greyscale :P
-
If it hasn't been already mentioned, an axiom focused around better graphics support.
Specifically, flood-fill, drawing polygons (not necessarily concave or complex, just convex would probably be adequate), and maybe support for quickly drawing curves (by implementing something like bezier curves, for example).
Although really, just having polygons would be epic.
-
Although really, just having polygons would be epic.
What about 3D, hidden surface polygons? That can and has been done.
-
Ah, you mean not wireframe, but no shading? Even dithering on a side for color isn't too hard. Been done in BBC Basic at least :P
-
Imaginary numbers, and a way to switch between a+bi and re^i(theta). The math for them is the same as vectors, 'cept for the dot product, so if that could be added in, that'd be great. Having vectors would make physics sooooo much easier.
-
You can have vectors in Axe simply by storing each component in a separate variable, and doing the dot product by just doing the math yourself X1*Y1+X2*Y2 :) I use vectors all the time in pretty much every single one of my games, I don't think you need Imaginary numbers in order to use them
-
It makes the math easier, specifically the cross product. The dot product comes from the matrix representation, so, yeah. That, and it makes switching between <a,b> and |v| (theta) representation a million×easier.
-
In that case, wouldn't a dedicated vector axiom be better than an imaginary number axiom?
-
I figured imaginary numbers would be easier, seeing as how they're already built in to the calc.
-
Well they are built in using Floating Point math, did you mean an axiom that gives you floating point accuracy vectors?
-
Umm, I have no idea what you just said. Could please elucidate for me, please?
-
None of TI's graphing calculators have an FPU (Floating Point Unit). The CPUs only work with integers. Consequently, all of their math routines are implemented in software, and that software sucks. The TI-83+'s FP routines are notorious for being slow and poorly implemented. The TI-83+'s imaginary numbers routines are considered part of the FP routines. Using the "built-in" routines would actually be pretty slow, compared to optimized routines using 8-bit integers and 8-bit fractionals. Additionally, TI's floats are 9 bytes long, so they're pretty large.
-
Sooo, it would be a bad idea to use the preexisting imaginary numbers? Just one thing though: floats are neccessary if you're going to be switching between <a,b> and |v| (theta) representations, because I can guarrantee that, in the vast majority of cases, at least one of those numbers will be irrational, because [advanced math stuff]while there are infinitely many Pythagorean triples, there are infinitely many more triples that are not Pythagorean.[/advanced math stuff]
-
Simple solution: We all write our own floating point math routines! It'll be CRAZY easy to do! Well...let's get to it! -.-
-
Ah, yes. We, who, for the most part are lacking advanced degrees in algorithmic theory, shall produce the best floaties in the world! BUWAHAHAHAHA!
-
Simple solution: We all write our own floating point math routines! It'll be CRAZY easy to do! Well...let's get to it! -.-
I can write you a 16.16 FP axiom if you wish :P
with range of 0 to 9999.9999. ;)
rather easy though, I'm sure.
-
I wonder if TI would take our software and put them in their OS. Personally, I wouldn't really mind :P as long as they gave some credit.
-
This Web site (http://z80.info/) has no fewer than three FP libraries. One of them lets you change the precision to suit your needs. Additionally, Ben Ryves could probably help you dike the floating point routines out of BBC BASIC.
-
BenRyves doesn't have the source for BBC Basic
He made a wrapper for a binary by this guy (http://www.bbcbasic.co.uk/bbcbasic/z80basic.html). I found this out on cemetech :P
-
I'm aware of this. He doesn't try to hide it. I'm pretty sure his BBC BASIC site links to the original BBC BASIC.
-
Line-test(StartX,StartY,EndX,EndY,Color(1,0),ResultX,ResultY[)r]
Would start at the Start coordinates, follow the pixels indicated by the Line algorithm and return the coordinates of the first pixel found of the color indicated (1=black, 0=white) to the variables indicated by the Result arguments.
-
Added Crabcake for Axe.
-
Crabcake for Axe has been updated http://www.omnimaga.org/index.php?action=dlattach;topic=7373.0;attach=7891 (http://www.omnimaga.org/index.php?action=dlattach;topic=7373.0;attach=7891)
1. Fixed 83+ BE bug
2. AxesOn/Off with the r modifier work now
It will be up to DJ_O and the rest of the contest designers on the basis of this update being allowed for the Axe Contest
-
Hmm I just had an idea...what about an axiom that takes in a number and outputs the key associated with that number? ie if the input is 9 then it outputs "ENTER"
This could be useful for utility programs, or a game where controls can be custom-assigned ;)
-
This could probably be done just as easily in Axe. All it would entail is reading entries from a list of strings for each key.
-
Hollow rectangle and/or clear rectangle?
-
How about this...4*4 sprite commands. Meaning, 4 digits of hex can be manipulated as a 4*4 and such just like an 8*8 sprite.
This way one wouldn't have to bother with changing the coordinates every time a rot()/flip() command is used and pt-off() would only erase a 4*4 rectangle.
-
OMG! I Just now realized that the Axiom I made is up there. Huh. Cool.
-
Could someone please make one to handle crystal timers? I realize no one has asked for them, and I just got a new 84 Plus SE, so I want to start toying with those. Maybe we could use the BASIC clock tokens for that.
-
And something that would allow us to mess with the clock
-
Could someone make an axiom that gets the calc id? I don't really know much about the process except that it can be done.
-
I think relatively specific things like reading and setting clock data and getting the calculator's ID are best left to inline assembly. Getting the calculator's ID is especially simple, I can whip up some code for it right now:
.Returns a pointer to the first 5 bytes of the calculator ID
.Returns 0 if unsuccessful
Asm(EF7E802199842803210000)
Control for crystal timers in Axe, however, would be a bit more complicated and possibly Axiom-worthy. It could be tricky to implement all the possible options with crystal timers while still retaining ease of use so you don't have to be the person who wrote it to understand how on earth to use it.
-
Thanks Runer.
-
Request: Axiom that enables the 2-channel sounds with format something like:
Command(channel1_note,channel2_note,freq) ?
-
Maybe we could use the BASIC clock tokens for that.
No. You have to include the 83+SE, which doesn't have those yet it has the crystal timers.
-
just wondering, would it be possible to write an axiom on-calc with mimas so that the development with axe is completely computer-free? im using a computer now, but it would be cool not to need one for anything axe-related.
-
You can use Mimas if you need to.
-
even though you need axe.inc and the libraries? or do you not? sorry if i sound noobish right now, i dont entirely understand axioms and how they are created just yet.
-
Axe.inc just includes a ton of equates like the addresses of all the variables, ram locations, constants, custom tokens, and other useful things like that. Also, it has a list of the subroutine call values required to make the Axiom inter-call other axioms and native axe routines. If you can memorize all those values or write them down elsewhere, then yes, you can definitely write the axiom on-calc with Mimas.
-
I think it would be possible to make a custom include file for Mimas, too
-
I think that it's worth looking into. I think i saw somewhere that you can upload a .inc file to an appvar in a form that mimas can understand.
-
I actually was doing that at one point, so it is possible, but I kept forgetting the axiom format :P
Anyway, since I can't upload files yet, here (http://jacob.heliohost.org/calc/axe/1.0.5/Developers/AxeInc.8xv) is a link to a Mimas version of Axe.inc.
I changed axv_Theta to axv_θ since Mimas supports the theta character.
Also, since Mimas doesn't support macros:
;REP_NEXT becomes:
DB REP_NEXT
RORG PC-1
;REP_NEXT(x) becomes:
DB REP_NEXT_OFF,x
RORG PC-2
-
Cool! Will try it out. Also, is there a way to edit a mimas program's appvar in text on a pc? I know that sort of defeats the purpose of using mimas in the first place, but it would be nice to transfer asm code that you were working on from your pc to the calc so you can code on the go.
-
Multiple tones at the same time when in some kind of loop?
Like
(CHORD)
freq(
freq(
freq(
(/CHORD)
-
Cool! Will try it out. Also, is there a way to edit a mimas program's appvar in text on a pc? I know that sort of defeats the purpose of using mimas in the first place, but it would be nice to transfer asm code that you were working on from your pc to the calc so you can code on the go.
Check out tools/8xvtoasm.exe and tools/asmto8xv.exe in the mimas folder, assuming you know command line.
EDIT: which you obviously do, if you are compiling assembly ;)
-
K thanks. And yes, i have extensive knowledge of both windows and unix command lines.
-
Multiple tones at the same time when in some kind of loop?
Like
(CHORD)
freq(
freq(
freq(
(/CHORD)
I tried that already, but it just produces random distorted garble D:
-
Just so this doesn't get lost to time, here's a 8.8 fixed point square root Axiom: http://ourl.ca/9165/257366
-
Multiple tones at the same time when in some kind of loop?
Like
(CHORD)
freq(
freq(
freq(
(/CHORD)
I tried that already, but it just produces random distorted garble D:
Make the notes longer for arpeggio's. You will never get sound blending without a custom routine.
-
Could someone update the list at the first post? I believe it is missing some of the newer ones.
-
I don't know if this is possible, but:
an axiom that turns the calculator off? such as in password programs?
-
I don't know if this is possible, but:
an axiom that turns the calculator off? such as in password programs?
You don't really need an axiom to do that ;)
http://ourl.ca/9749
-
I don't know if this is possible, but:
an axiom that turns the calculator off? such as in password programs?
You don't really need an axiom to do that ;)
http://ourl.ca/9749
ooh yay!!!! :D
-
Also, if you look far enough into that thread, you'll see my version which deallocates your program. So, use the simple 3 byte command for apps and my much longer one for programs.
The Post (http://ourl.ca/9749/187839)
Edit:
Jk, The Real Post (http://ourl.ca/9749/188203). Yes, this is the right one
Edit2:
I thought I made a better one (http://ourl.ca/10110/250926)
-
Can someone make a smaller font, like, 4*3 or something? I've been mentally putting together a HUD and the normal Text() font is just too big at times :/
-
What would an uppercase E look like if it was only 4 tall? o.O
-
***
***
*
***
Somewhat recognizable :P
-
I was thinking something like
..but that could work too.
(even if the font has to be all-caps it would be worth it :) )
-
Ah I see, maybe it could work ^^ maybe an Axiom that lets you define your own font set?
-
I actually was doing that at one point, so it is possible, but I kept forgetting the axiom format :P
Anyway, since I can't upload files yet, here (http://jacob.heliohost.org/calc/axe/1.0.5/Developers/AxeInc.8xv) is a link to a Mimas version of Axe.inc.
I changed axv_Theta to axv_θ since Mimas supports the theta character.
Also, since Mimas doesn't support macros:
;REP_NEXT becomes:
DB REP_NEXT
RORG PC-1
;REP_NEXT(x) becomes:
DB REP_NEXT_OFF,x
RORG PC-2
Page isn't loading at the moment. D: If you can provide the file I'll attach it to your post. :)
-
Perhaps a floating-point-math Axiom, with a function to store a float to an axevar?
-
Ah I see, maybe it could work ^^ maybe an Axiom that lets you define your own font set?
Like, absorb a zStart/Omnicalc/Grammer(if it uses appvars or something) font set, take the height/width parameters and work from there?
That would be cool, even more versatile ;D
-
Perhaps a floating-point-math Axiom, with a function to store a float to an axevar?
How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.
Page isn't loading at the moment. D: If you can provide the file I'll attach it to your post. :)
Added the file directly to the post.
-
Ah I see, maybe it could work ^^ maybe an Axiom that lets you define your own font set?
Like, absorb a zStart/Omnicalc/Grammer(if it uses appvars or something) font set, take the height/width parameters and work from there?
That would be cool, even more versatile ;D
That would be really cool and handy. Sometimes, you just need a small font for stuff.
-
Perhaps a floating-point-math Axiom, with a function to store a float to an axevar?
How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.
There is only one kind of truncation. It's where you chop off the decimal portion. Or, to put it another way, round towards 0
-
What do you mean AxeVar? You mean in the 2 bytes provided by each default Axe variable?
-
What do you mean AxeVar? You mean in the 2 bytes provided by each default Axe variable?
Yes. Isn't that what they're called?
-
Perhaps a floating-point-math Axiom, with a function to store a float to an axevar?
How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.
There is only one kind of truncation. It's where you chop off the decimal portion. Or, to put it another way, round towards 0
By how you want it truncated, I mean what do you want it truncated to.
-
Wait you want to fit floating point data into 2 bytes of space? o.O There is barely enough space there for any accuracy at all D:
-
Perhaps a floating-point-math Axiom, with a function to store a float to an axevar?
How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.
There is only one kind of truncation. It's where you chop off the decimal portion. Or, to put it another way, round towards 0
By how you want it truncated, I mean what do you want it truncated to.
Truncation is a mathematical function. You truncate to a number. To put it in BASIC, iPart()
-
Truncation (http://en.wikipedia.org/wiki/Truncation) limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.
-
Perhaps a floating-point-math Axiom, with a function to store a float to an axevar?
How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.
There is only one kind of truncation. It's where you chop off the decimal portion. Or, to put it another way, round towards 0
By how you want it truncated, I mean what do you want it truncated to.
Truncation is a mathematical function. You truncate to a number. To put it in BASIC, iPart()
But what kind of number would you like? An unsigned integer, a signed integer, 256 inflation, some form of signed 256 inflation, bcd, a pointer, a handle...
-
http://en.wikipedia.org/wiki/Truncation (http://Truncation) limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.
16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.
And there is no difference between signed and unsigned. For example: -1 and 65535 would both turn out to be 1111111111111111b. 65536 would be 0. Also, sin() and cos() would be super useful. And square roots, too.
-
Ahhhh i see, i thought you wanted an Axiom to use the 2 bytes in each AxeVar as floating point data, so we could have native FP in Axe ::) If all you want to do is convert TiOS Floating Point variables into Axe variable (while truncating all the decimal points) you can use the already build in float{} command :D
-
Ahhhh i see, i thought you wanted an Axiom to use the 2 bytes in each AxeVar as floating point data, so we could have native FP in Axe ::) If all you want to do is convert TiOS Floating Point variables into Axe variable (while truncating all the decimal points) you can use the already build in float{} command :D
But I can't do math with them in that state. I want [sings]maaaaaaaath![/sings]
-
http://en.wikipedia.org/wiki/Truncation (http://Truncation) limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.
16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.
But what do you want me to do with a floating-point number like 100000?
-
http://en.wikipedia.org/wiki/Truncation (http://Truncation) limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.
16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.
But what do you want me to do with a floating-point number like 100000?
Wrap around, so it'd be mod 65536
-
Oh i believe there is already an Axiom somewhere that does math to TiOS floating numbers, I don't know where it went tho D:
-
http://en.wikipedia.org/wiki/Truncation (http://Truncation) limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.
16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.
But what do you want me to do with a floating-point number like 100000?
Wrap around, so it'd be mod 65536
Going by that, I would assume that you want unsigned integers... but what if the floating-point number is negative?
-
http://en.wikipedia.org/wiki/Truncation (http://Truncation) limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.
16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.
But what do you want me to do with a floating-point number like 100000?
Wrap around, so it'd be mod 65536
Going by that, I would assume that you want unsigned integers... but what if the floating-point number is negative?
represent it as it would be if it were a negative two's complement 16-bit integer.
-
http://en.wikipedia.org/wiki/Truncation (http://Truncation) limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.
16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.
But what do you want me to do with a floating-point number like 100000?
Wrap around, so it'd be mod 65536
Going by that, I would assume that you want unsigned integers... but what if the floating-point number is negative?
represent it as it would be if it were a negative two's complement 16-bit integer.
ok... but what about -32769?
-
/me shrugs
Well, there's a float{} command that can do the conversion (which I just remembered) so don't worry about it.
-
And then you can use this (http://ourl.ca/13650) for the mathematics :D
-
Can someone whip me up an axiom that is similar to the basic date and time commands?
-
Sorry, i know nothing of asm, but in the calculators (84+ family) that have the crystal timer, have their data stored somewhere. If you can find the location of that, you could simply read from the location. Might like to try a different section.
(i might be wrong about everything)
-
AFAIK, the crystal timers have nothing to do with the clock (they are two different things).
The problem is not reading the value of the clock, but the fact that it doesn't fit in an axe variable.
Regardless, you can get the value of the clock like this:
°AAsm(DB02E6202009AF0604772310FC180FDB477723DB487723DB457723DB4677)
and AB would contain the number of seconds since midnight, January 1, 1997, or 0 if the clock is off or the calculator has no clock.
°AAsm(DB477723DB487723DB457723DB4677)
or this if you know that the calculator has a clock
Also, running ClockOff on my TI84+SE does not turn the clock off (just doesn't display it in the mode menu).
-
Ohhh... Should be super easy!
But this would help me.
Vertical +
but will only shift the first 48 rows.
I wouldn't ask normally, because of being a bother, but as most of the code is already in axe, I think it could be done rather quickly. Thanks
-
For Vertical+ or Vertical-, you can code that in pure Axe.
Vertical-
Copy(48*12+L6,47*12+L6,47*12)r
Vertical+
Copy(L6+12,L6,47*12)
EDIT: Oops, the following is Horizontal +:
Asm(214093AF0606CB1E2310FBC60420F5)
The part I bolded you can change to shift the first N column groups of 8 pixels. So right now, 6*8 = 48 pixels shift. Changing it up to 0C (which is 12 in decimal) shifts the full 96 pixels and is the original Horizontal+ command.
-
thank you so much.
This will be much faster right?
-
So basically you could shift only half of the screen with that?
AFAIK, the crystal timers have nothing to do with the clock (they are two different things).
The problem is not reading the value of the clock, but the fact that it doesn't fit in an axe variable.
Regardless, you can get the value of the clock like this:
°AAsm(DB02E6202009AF0604772310FC180FDB477723DB487723DB457723DB4677)
and AB would contain the number of seconds since midnight, January 1, 1997, or 0 if the clock is off or the calculator has no clock.
°AAsm(DB477723DB487723DB457723DB4677)
or this if you know that the calculator has a clock
Also, running ClockOff on my TI84+SE does not turn the clock off (just doesn't display it in the mode menu).
Ooh, great!
-
By the way I corrected my previous post because I had accidentally posted Horizontal+
-
removed
-
You can use L3 if you want.
-
I replaced Vertical+ with the code, and the code isn;t working. *removed*
-
What I'd like to see is an axiom that adds gCn support.
I imagine that this would be pretty hard to make, but it would be pretty great...
-
What I'd like to see is an axiom that adds gCn support.
I imagine that this would be pretty hard to make, but it would be pretty great...
i could take a stab at this tonight if you want. give me a few hours and i will see if i can pull something together maybe...need to relearn basic axe
(i already have gcn practice lol)
also you will need the dcs app installed regardless thats not like removable.
also how automated do you want the axiom to be
should it handle everything including finding and keeping tabs on the amount of people in the hub. Or should it just set it up and expose the routines needed?
also what token should i use </doesnt care>
-
I don't really care about the token, since I wouldn't have any conflicting token issues anyway...
And as to how automated it should be, my general request would be these general features:
-Send/receive information from the hub
-list of players/number of players
and thanks for taking on my request :D
-
Can you update this list with all current axioms (Fullrene, Floating point math) And axiom in project ?
-
started the calcnet axiom thread here
http://ourl.ca/15186
its getting there most of the code is done i just have to test it which is proving to be a pita cause well idk axe xD
EDIT: see above >.> <.<
-
I'm not sure if you realize that you just posted a link to the "normal post" icon for threads.....
-
I'm not sure if you realize that you just posted a link to the "normal post" icon for threads.....
uhh fail......
-
Maybe a Power coder could make an Axiom to write to flash without using the Unarchive/Archive command, but with unlocking ROM and all (of course, the Axiom would lock it back after writing to it).
This may not be faster than Unarchiving/Archiving but would be useful for a game that has a huge savegame, if it is run on a regular 83+ (with not a lot of ROM) to avoid GarbageCollecting.
-
Maybe a Power coder could make an Axiom to write to flash without using the Unarchive/Archive command, but with unlocking ROM and all (of course, the Axiom would lock it back after writing to it).
This may not be faster than Unarchiving/Archiving but would be useful for a game that has a huge savegame, if it is run on a regular 83+ (with not a lot of ROM) to avoid GarbageCollecting.
You can't write a savegame over the last savegame in flash. You have to put it in a currently unused flash area (which is exactly what Archive does)
-
You can't write a savegame over the last savegame in flash. You have to put it in a currently unused flash area (which is exactly what Archive does)
D:
Not even by rewriting the whole flash page where the savegame is ? :P
I mean you copy the page somewhere somehow, then replace the savegame in your copy, then copy the modified copied page onto the old page.
-
When Axioms are released, do they automatically get included by default with newer Axe releases?
-
When Axioms are released, do they automatically get included by default with newer Axe releases?
I don't think so, it's possible they might get included in the future, but I had to download mine separately.
Perhaps they could do something like #include <stdio.h> like in C? but instead for axioms?
-
Axioms would not be included as part of the app file itself. Axe needs that space for other improvements to the language, not to store Axioms. Since the axioms are basically third-party plugins to Axe, I'd say they'll probably stay as separately downloadable files. There may be a few really commonly useful Axioms that might find their way into the download files at some point, but I don't think there will ever be a comprehensive set of all released Axioms in the releases themselves.
-
I think DJ_O's question was more "are new Axioms included in the zip", not "are new Axioms included in Axe". I may be wrong though. Anyway, in both cases the answer is "no" :P
Perhaps they could do something like #include <stdio.h> like in C? but instead for axioms?
Well, that's how they currently work, no ?
You have to do #Axiom(TEXT) to include the commands from the TEXT Axiom, isn't it what you want ?
-
OK, something that I need is an InData that actually checks the data, not just strings. InData's great and all for strings, but I need one for actual data. I've tried writing my own out, but it never seems to evaluate. I'm going to post it in the help pages, but still having that function would be greatly appreciated. Also if it returned 65535 if it wasn't found instead of 0(as the data is 0 indexed) would also be greatly appreciated.
-
In memory, there is no difference between "actual data" and "strings" in Axe. "HELLO WORLD" is literally equivalent to [48454C4C4F20574F524C44] which is also equivalent to Data(72,69,76,76,79,32,87,79,82,76,68)
-
In memory, there is no difference between "actual data" and "strings" in Axe. "HELLO WORLD" is literally equivalent to [48454C4C4F20574F524C4400] which is also equivalent to Data(72,69,76,76,79,32,87,79,82,76,68,0)
Fixed it for you: Axe automatically adds ending NULs to the end of strings.
-
Just noticed this topic and i happen to have an axiom request: Allow AppVariables to be executed from flash! :D
So propably similar to pageswap then only that it uses appvars.
-
Just noticed this topic and i happen to have an axiom request: Allow AppVariables to be executed from flash! :D
So propably similar to pageswap then only that it uses appvars.
Why appvars? Why not programs?
-
because appvars are more invisible to the end user
-
The runprgm Axiom (http://www.omnimaga.org/index.php?action=downloads;sa=view;down=786) lets you convert an assembly/Axe program into an appvar, and execute it. The only difference between a program and an appvar is the type byte, so it was easy functionality to implement. Of course, the program is still copied to RAM and run from RAM. Executing an appvar in flash without coping it to RAM is just too much of a headache, due to both the need to change the execution permissions (requires unlocking flash), and the fact that the location would be variable and might cross page boundries. If you really want execution from flash, use an application.
-
Axe automatically adds ending NULs to the end of strings.
Not always. It adds a zero when the string is followed by a → and when it is inside a Text command, but if you do this:
"String1"
"String2"
none of them will be null-terminated, you need to do that:
"String1"[00]
"String2"[00]
This can be useful when for example you need to put a @ in the middle your text data, you just have to write this: "mymail"[48]"gmail.com, where 48 is the hex for @ (note that the true hex is not 48, I put that number at random).
-
The runprgm Axiom (http://www.omnimaga.org/index.php?action=downloads;sa=view;down=786) lets you convert an assembly/Axe program into an appvar, and execute it. The only difference between a program and an appvar is the type byte, so it was easy functionality to implement. Of course, the program is still copied to RAM and run from RAM. Executing an appvar in flash without coping it to RAM is just too much of a headache, due to both the need to change the execution permissions (requires unlocking flash), and the fact that the location would be variable and might cross page boundries. If you really want execution from flash, use an application.
The problem is that with that axiom I can't call functions that are not part of the appvar/the prog.
-
The runprgm Axiom (http://www.omnimaga.org/index.php?action=downloads;sa=view;down=786) lets you convert an assembly/Axe program into an appvar, and execute it. The only difference between a program and an appvar is the type byte, so it was easy functionality to implement. Of course, the program is still copied to RAM and run from RAM. Executing an appvar in flash without coping it to RAM is just too much of a headache, due to both the need to change the execution permissions (requires unlocking flash), and the fact that the location would be variable and might cross page boundries. If you really want execution from flash, use an application.
The problem is that with that axiom I can't call functions that are not part of the appvar/the prog.
What do you want to do? If your main program is an application, the program you called can call functions in the application if you swap it back into memory. There's already an Axiom for that.
-
By request of Hayleia and nikitouzz.
#Axiom(MEMKIT2) | |
Load() | Key: Xmin |
Next() | Key: Xmax |
dim() | |
dim()r | |
dim()rr | |
Print(BUF) | Key: Xscl |
New(PTR,OFS,SIZ) | Key: Ymin |
Delete(PTR,OFS,SIZ) | Key: Ymax |
-
For those who wonder what this version of MEMKIT adds to the memkit bundled in Axe's zip, well nothing :P
But it uses a set of tokens that is compatible with Jacobly's TEXT Axiom :)
And Jacobly made (yet) another version of MEMKIT that sorts by alphabetical order, here (http://ourl.ca/18464/340684) :)
-
I would like an Axiom (or an hex code if it is less bothering to write) that would basically be the DispGraphrr command, but with no checkerboard pattern. I mean that it would make the whole buffer flicker instead of making two cherckerboards flicker alternatively (not sure if I am clear).
Would it be possible ?
-
What would be the purpose of such a command? It's possible that I'm misunderstanding your request, but to me it sounds like you're asking for a command that doesn't attempt to create grayscale by combining the main and back buffer contents each frame, but instead only provides the grayscale "weighting" for each pixel by displaying the full main buffer twice for every time the full back buffer is displayed once. If this is what you're looking for, couldn't the affect be achieved in native Axe, like this?
DGInit()
...
DG()
...
Lbl DG
If C-1→C
DispGraph
Return
End
DispGraph(L₃)
Lbl DGInit
3→C
Return
-
Lol, indeed that's what I wanted.
Thanks.
-
I want to introduce my new Axiom.
It's for creating and managing arrays at random memory locations.
When you created a array you can easily add or delete elements.
There's also a routine to go through all elements with a callback function and delete elements by the return value of the callback function.
It's very useful for making games where you have to handle many objects (as bullets or enemies).
I attached the source and the compiled Axiom but sadly I haven't written a readme file yet.
(tokens are in the 'ZOOM' menu)
It's my first assembly project and I would be glad if someone helps me optimizing it :D
-
sounds awesome! :D
-
So here is a first readme with an explanation of all the commands.
I plan to make a Length command and a Reset command that clears the list (array).
-
Oh epic, an array handling Axiom ! ;D(http://www.omnimaga.org/Themes/default/images/gpbp_arrow_up.gif) You got my +1 !
-
I see two things that I think are not right :
- MaxLength and the actual length of the array both take 1 byte. That's not enough in most situations. For example, in IkarugaX my bullet engine handles 192 bullets, and each bullet is an 11-bytes entry. 192 * 11 = 2112, which won't fit in 1 byte.
- I can't see any function to retrieve individual elements from an array ...
Also, IMO in LScanD you should just stop the scan instead of deleting the current element if HL ≠ 0.
-
I see two things that I think are not right :
- MaxLength and the actual length of the array both take 1 byte. That's not enough in most situations. For example, in IkarugaX my bullet engine handles 192 bullets, and each bullet is an 11-bytes entry. 192 * 11 = 2112, which won't fit in 1 byte.
The MaxLength counts the elements in the list, not the bytes. You can therefore store up to 255 bullets in the list. Each bullet data itself has the size of ElementSize which is up to 255 again. A list of 255*255 bytes + 5 bytes for info would barely fit into RAM.
- I can't see any function to retrieve individual elements from an array ...
Yeah I forgot that one D: . I will add it soon
Also, IMO in LScanD you should just stop the scan instead of deleting the current element if HL ≠ 0.
Why ?
This function should help you to display all objects (for example bullets) and delete those that are maybe out of the screen.
-
Idea : add a map function to apply to the whole list a function, with a lambda for instance.
For instance if the Map fnctions returns the adress to r1. Struct : x, y, type
MAP(LIST, log(Pxl-On({r1}, {r1+2}, {r1+3}*8+Pic1))
-
In fact you can do that with the ScanF() function. You pass the lamda which returns the adress of the subroutine as the first parameter and make somthing like Pxl-On({->r1}... to store the pointer given in HL to r1 and use it further.
By the way I forgot a command in the DelI() function. I will post a update tomorrow (with Get() function to get a pointer to a specified element and Length() to easy access the length of the list.
Edit: Here it is. Hope I didn't make any mistakes yesterday night <_<
I'm going to make an example program soon
-
I'm currently making a Menu( axiom.
For the time being, it's a beta and isn't very user-friendly, but I'll improve it ! You can try it here (http://www.omnimaga.org/the-axe-parser-project/menu(-command-using-os's-bcalls-need-assembly-help/msg391091/#msg391091). Don't forget to read the post with the explanations !
EDIT : Axiom finished !
(http://www.omnimaga.org/the-axe-parser-project/menu(-command-using-os's-bcalls-need-assembly-help/?action=dlattach;attach=17914)