Join us on Discord!
You can help CodeWalrus stay online by donating here.

Some super crappy Axe code...

Started by p2, August 24, 2016, 11:41:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

c4ooo

Quote from: DJ Omnimaga on September 03, 2016, 09:07:57 PM
Weird, I was sure graylib was ASM, since it can generate perfect grayscale.
It is asm. You can have inline ASM in axe.

E37

#76
INFORMATION OVERLOAD!
(I've been working on this for the past couple weeks)
Formatting!
[spoiler]
Ok, so here is the format that I will be using when I explain things:
But first... a little math. Pause 1 takes up 3349 cycles. Pause 1800 is about a second in slow speed mode. 3349*1800=6028200 cycles a second. Just to give you an idea when I talk about speed.
In Axe 'Ans' is the register 'HL'. I will refer to Axe's answer either as HL OR Ans (neither are actually of course typed in code)
I will start hex numbers with a $ following assembly tradition. (Yes I know in Axe it is that little 'E' but that can be easily confused) It will look like this: $E37 That is the hexadecimal number 'E37'
Also in assembly format binary numbers are started by a '%'. That would look %10101010 OK? (Yes Axe stars them with a pi sign)
[/spoiler]

'and' and 'or' statements!
[spoiler]
I'll try to go over all the ways to do and and or statements. Ill bring in to account the size, speed and problems with the statement.
With all of them I am going to take into account the worst case for them. (slowest and largest)

1. " and " and " or "
Speed: 33 cycles - that's pretty quick.
Size: up to 7 bytes - not to bad.
Pitfalls: it only compares the lower byte of each argument. That means if number mod 256 is 0, it will treat it as 0. Only use if you are sure if this won't matter or if neither of the arguments can exceed 255.

2. "*" and "+"
Speed (for "*"): It can get up to 800 cycles - by far the slowest!
Speed (for "+"): It can get up to 32 cycles - not too bad.
Size: up to 5 bytes for "+" and 7 for "*" not bad.
Pitfalls: It has a chance that the math operations can wrap around and =0. It's not very likely though.

3. "?" and "??"
Speed: 18 cycles - that's screaming fast!
Size: always 5 bytes - that's really small!
Pitfalls: None really. Just watch the short circuiting as it can cause a headache if you forget it!
Note: since it is a short circuit operator, it has a chance to increase speed even more - even a large amount!

4. plot style tokens
Speed: 45 cycles - not the fastest.
Size: up to 10 bytes - pretty small!
Pitfalls: They can be hard to differentiate, "That's 'or' right... no, its 'and'!"
Notes: It functions the same way as " or " and " and" but doesn't have the >255 problem.

5. nested 'If" statements
Speed: who cares?
Size: does it matter?
Pitfalls/notes: ... just no. Don't do it. Any coder who tries to read your code where you made a separate 'If' for each and and calls the same routine for each 'or', will HATE you (and you probably won't be able to read it anyway) That kind of code is for assembly! NOT Axe! As mentioned, this dosn't mean never use 'If' statements, just don't use them instead of an 'and' or 'or'.

That is all of the ways I can think of. Read over all of them and decide which is best for yourself.
[/spoiler]

Select(!
[spoiler]
This guy is kinda of tricky. It sound really complicated and large, but it is really very fast and small.
What do I mean? Lets talk size. It takes up 2 bytes! Thats awesome! Simply typing in any number is 3 bytes!
Speed? 22 clock cycles. Screamin' fast. (An 'If' statement takes 18 cycles)
It is really used if you want to evaluate an expression and don't want it to affect HL.
That will be REALLY useful when I get to optimization. Not that great otherwise.
[/spoiler]

Where is data anyway?!?
[spoiler]
Maybe you know, maybe you don't. Data is stored at the end of the program. So what? It is stored IN ORDER that is declared in the program. OK?
Will be helpful for optimization later.
Also, if you overflow a data buffer, it will affect the one after it!
[/spoiler]

Optimize!
[spoiler]
There is a lot of things for this. I'll go over some of the main points.

The most effective kind (besides organized code) is answer optimization.
Look at this code for example

:If COND
:Text COND>Char
:End

Anything you can do to optimize this? It may look fully optimized, but it isn't.

:If COND
:Text >Char
:End

Since the If statement already evaluated the condition and it is displayed right after, we don't need to re-evaluate it. COND is already stored in HL.

How about this:

:If A=5 or A=8 or A=37
:.Code
:End

What about that? It could be:

:!If A-5?-3?-29
:.Code
:End

What did I just do?
Think about it this way: plug a number in for A. Then run it through the first statement, and the the second. Remeber that the code after '?' is evaluated if the previous code is non-zero.
Lets use 37.
:37-5 that is 32. it is non-zero so we move on to the next one.
We use the previous answer for the next one so the equation is:32-3 That is 29. 29 is non-zero so we move on to the next one.
:29-29 that is zero so we return 0 and the If statement code executes.
If it wasn't 0 then it would return that number and nothing would happen.
If it was 0 on one of the middle steps, then the '?' would read 0 and return 0 to the If statement and the code would run.

Math operations:
Have a math operation that is the same but you use it a bunch?
How about this one, it gives the end of a file as a location:
:PTR+{PTR-2}r
And you look at that code and say: "Wait a sec E37, you can answer optimize that!" ... and you'd be right!
Does this look better?
:PTR+{-2}r
There! that saved... 0 bytes!?!
If you test that, it is the same size both ways!
WHY IS THAT! Surprise! Axe automatically optimizes it for you.
Proof?
[spoiler]
Compare the compiled size of :A+{A-2}r to that of :A+{B-2}r
They're different! The only way that could work is if Axe does that automatically!
Thanks Runer112!
[/spoiler]
(well.. at least it looks cleaner and your source is smaller)
Remember Data? (look back if you don't. I promise it is short!)
Here is where it comes in handy!
:"1224"[00]->str1   //string1
:"5678"[00]->str2   //string2
Imagine you want to chose want to choose string1 if X=0 and string2 if x=1
:If X=0      //yes I know you can optimize this
:Disp Str1
:ElseIf X=1
:Disp Str2
:End
Don't use an If statement!
try this instead:
:Disp X*5+Str1
Note that this fails if X is greater than one. But, it is a heck of a lot smaller and faster!

About those If statements then:
Compare :If A=1 and :!If A-1
They're the same size right?
NO!
If A=1 is 6 BYTES LARGER!

Lets try something else
How about :0->{A}
You can't optimize that!!! E37 you're crazy!
Really? Oh, but you can!
: xor 0->{A}
Wait... What?!? That's larger right?
*saves one byte
How?
It gets into how Axe stores constants.
All numbers in Axe take up 3 bytes. Yup. A program that has just :SOMENUMBER will be 3 bytes.
Note that 0 and 25565 take up the same amount of space in the program! Making the number less that 256 doesn't help.
xor has a special condition that if one of the arguments is 0 it only takes up 2 bytes. ;)
Don't start replacing all of your 0's with xor 0 !!!
That is only the 1 byte xor!
In my example, {A} can only take one byte.
If I had used {A}r instead, xor 0 wouldn't have worked.

Sometimes, a complete rewrite is necessary. I found that a complete rewrite (without the original code handy) can be very beneficial.

Some memory hacks:
If you desperately need 10 bytes of free ram, how about using a file. What? Each file takes up 10 bytes of space, and you can use them for yourself! (assuming you don't need to use the file) Were can you find their location? :Disp °Y1 >Hex will give you the location for the file!

[/spoiler]

Pathfinding!
[spoiler]
Subroutine: AStar
CALL   PushNode(OpenStack,StartingX,StartingY,0,0,0)   // this sets the starting node and sets it's distance to the goal to 0. (that value doesn't matter it can really be anything since the x and y cords. determine if the goal has been found) I set its parent's x and y to 0 so when I am calculating the path at the end, I know that it is the starting node.

While ("tmpOpen" is not empty){
    If (!PathFound){
    CALL    Calc1Node       //this doesn't really need to be a subroutine but it makes it easier to read
    }Else{
    Return    //Sucess! Each node points to the previous one in the path so all you need to do is return up the stack starting with the node on the goal
    }
}
Return          //Fail! no paths exist to the target!

Subroutine: Calc1Node
Find the node that is the closest to the target on the open stack and pop it off the stack. You should ignore the node if it is on an impassible tile or already exists - It is perfectly fine to only add a couple nodes. You will only add 8 nodes on the first tile as every other tile will be adjacent to the tile that called it.
Calculate the 8 nodes nearest to it and their distance from the target (I used sqrt(abs(Y-TargetX)2+abs(Y-TargetY)2)+ValueOfTile  ValueOfTile is how much movement is needed to cross this tile - higher numbers are harder to cross!)
Push each of the nodes onto the open stack. Make sure to have them include their parent node's location! However if the node is on the goal tile, push it to the closed stack and set PathFound to true.
Push the node that was evaluated (the one that was popped off when this was called) onto the closed stack
Return

PushNode
/*
Node Structure
Toal: 6 bytes
1b: NodeX
1b: NodeY
2b: Distance to goal
1b: parentX
1b: parentY
*/
Pushes the node to either the open or closed stack. I inserted memory on the end of the appv to do the least amout of shifting. I also refound the pointers for both stacks in case they moved.
Return

PopNode
//pops a 6 byte node off the open stack. See node structure...
I used deleteMem once the data was retrieved.
I also refound the pointers for both stacks in case they moved.
Return

Define: "tmpOpen"       //list of nodes left to be checked
Define: "tmpClosed"    //list of nodes that have already been checked

Note: this returns the path form finish to start. You will want to make the goal pathfind to the unit!

[/spoiler]

Map compression!
[spoiler]
Let's pretend you are making a game. Most games have multiple maps, it takes up a lot of space to have multiple arrays to hold all your maps.
Here is how to make all your maps (with in reason) take up the space of one!
First you need to know the number of tile types. If your game just has air, grass, and stone, then there is 2 (assuming that the first tile type is 0)
You need 2 maps. They must be the same size!
I want to edit the slot. I will set the slot on the compressed matrix equal to: (valueOfFirstMap) + (valueOfSecondMap*Prime)
What? Where did that prime come from? That is what lets me compress the map. The prime must be bigger that the amount of types.
In my example, I had 3 different types. I will pick 5 since it is the first prime greater than 3.
If you do mod (prime), then the remainder will have to be the first map's entry because the second entry will be some multiple of the prime and come out evenly. Divided by the prime will ignore the remainder (the first layer) and only give the second map.

Want more maps?
lets pretend that you have a total of 3 types of tiles for each layer
How to add / get from any of the layers (Let's pretend there are 3):
The first prime will be 5. that is the smallest prime that is greater than 3 (the supposed total number of tiles for the first layer)
If there are 3 types on the next, here is how to get the next prime. 3*5 +3 is 18. That is the highest number that the the first 2 layers combined can be right?
Well, for the third layer, we need a prime bigger than 18. let's use 19. You add the third layer to the total of the previous two.
To get layer 1 and 2 it is the same as above. To get the third, just divide by the second prime (19 in the example)


You can continue this pattern until it overflows. (if the max you can hold in one entry is 2^16, then the highest possible entry must be less than that)

It works well for multilayer maps, but it will work for any sets of data that are the same size.
[/spoiler]

Extras!
[spoiler]
Memory locations:
$86D7 and $86D8
That's the location of the graph screen pen's x and y coordinates respectively.
Right next to the 'appv' key is 'var'
What's that?
Try: float{GetCalc("varA")}->A
Now A holds the value of the OS letter variable 'A'. It still is in the range of 0-65535.
Or: A->float{Getcalc("varA")}
Will store the value of Axe's A to the OS's 'A'

Tired of making appv data files and then deleting them once the program exits?
Then this is the trick for you!
Replace "appv" with the "tmp" key that you kinda of ignored. (you know you did)
All 'temp' files are automatically deleted when you exit the program!

$844C->CurCol
$844B->CurRow
These are the locations of the column and row of the cursor in the homescreen. Output(5,6) is the same as 5->curCol:6->curRow

Although L2 in the Axe documentation is only stated as being 512 bytes it actually is over 800! That's enough to be an extra buffer with space left over for variables!

Crash!
Ever wanted to make you program crash? (but not the nasty kind that makes you pull the batteries)
Simply type :Goto (0)
It will do a nice crash-reset RAM that will only make you press the on key.
Nice if your program corrupts memory. (but you were going to fix that anyway right?)
[/spoiler]

Axioms?!?
[spoiler]
Ever wanted to make an axiom? (assembly knowledge required)
I decided to write a tutorial on how to create an axiom using Mimas.

Getting set up:
Download Axe. Open up the folders in it and find the files called TokenHook.inc and Axe.inc.
Download Mimas. Open it up and find the file asmTo8xv.exe.
Drag both files one at a time over asmTo8xv. They might need to be in the folder for it to work.
That should create the files TOKENHOO.8xv and AXE.8xv
Send TOKENHOO.8xv and AXE.8xv to your calc.
(If you don't already have Mimas and Axe this probably isn't for you)

Create a new program IN MIMAS. Whatever you name it, DON'T name it the same thing as what your axiom is going to be called.
Open the menu for that program and chose 'Libraries'. Add both TOKENHOO and AXE.
Now you are ready to start programming!
If you are unfamiliar with the Axiom format, Axe has a file on it in the 'Developers' folder.

Here is some example code, with descriptions:

DW AXM_HEADER
;This tells Axe that this is an axiom
;these name can be found by pressing 2nd + catalog and opening AXE
DW DispHLEnd
;sets the size
DB AXM_ALL
;It works for all compile types
DB $27,$00
;It will be the token fMin( found under math
DB AXM_INLINE
;It is inline
DB AXM_1ARG
;1 argument, A number in this case
RORG 0
;This is the start of the axiom's code!
BCALL DispHL
;The argument is already in HL. All we have to do is display it!
DispHLEnd:
;End of this command's code
DW $00
;The end of the axiom
DW hFmin
;which token to replace
DB 6
;the replacement is 6 characters long
DB "DispHL"
;thats all!

Now to compile!
Before compiling choose your axiom's name. It MUST be different from the code's name or it WON'T WORK!
Create a program in a include your axiom.
Compile once with Axe to convert the axiom to an appv.
Once you open you program (not the Mimas one!) the token replacements should show up. (if you made any)
If it just displays one empty line, your token repalcement was bad. Pull the batteries and try again.
You should have successfully created an axiom with Mimas!
[/spoiler]

Using Hex
[spoiler]
Here is some hex and examples to help optimize your code.
DispGraph: Asm(EF7150)
This is a much slower form of Axe's dispgraph. It will only be useful if you have never used dispgraph anywhere in the program.
It does give a very nice size reduction though.
If you know any assembly, it can be used to replace some Axe functions and you can gain in speed and size!
This goes especially well with the Mimas.
In libraries that require an axiom (like memkit), you can remove the axiom requirement and add inline hex instead.
I guess I should mention that there is nothing special about axioms. Anything that can be accomplished with axioms can be done with inline hex. (loops can get tricky though and you may need to some hacky things to add them - such as adding axe labels and passing the hex the address as an argument!)

Here are some cool things you can use...
:.some code
:Goto Gbd1HEX // this can also be a subroutine instead
:
:[] -> Gbd1HEX
:[*assembly code in hex here*]

This will result as the hex code being run as if you called it with Asm() !
[/spoiler]

"Hacking" Axe
[spoiler]
I have seen people asking for a function in Axe to return X number of times.
Runer said he wouldn't add something to do that.
Here is how to do it anyway! (there is a couple cases where things could go wrong - this "doesn't work" if it is called from inside a function that needs commas like Text(arg1,arg2,arg3) )
Asm(E1C9)
What? That's all? Yes. repeat the E1 for how many times you want to return. If you wanted to The above example would return from the subroutine and return from the one that called that.
If you return too many times (like returning twice while not in a subroutine) bad things will happen. I'm not entirely sure what, but it starts with a simple crash and can get worse from there.

How to make it work from inside a function with commas:
[spoiler]
For each comma before the function, add another E1. If the call is the 3rd argument, add two E1's.
[/spoiler]

How to return and jump to a label:
LLabel:Asm(D1E3C9)
Make sure the label is preceded by the little L for the address of the label. Again, you will need to add extra D1's to compensate for commas or to return multiple times.

[/spoiler]
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

p2

I got a little understanding problem about the Axe modifications:
instead of asking stuff like this
If X=2: 4->Y: 6->Z: End
I could go and use the register HL for it:
If X=2: +2->Y: +2->Z: End
But wouldn't this actually make the code slower? This is what I think the processor does in those two cases:
Code (THE FIRST CODE) Select
load X
load "2"
*compare*
load "4"
store
load "6"
store

Code (THE SECOND CODE) Select
load X
load "2"
*compare*
load "2"
*addition*
store
load "2"
*addition*
store

Wouldnt the second code be slower due to higher number of loads and to multiplications...?

And is it the same when using that ?X+4 way of writing conditions? :)
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

E37

If X=2: +2->Y: +2->Z: End
wouldn't work. The = statement returns 1 which would make Y=3.
Speed? Honestly, unless that is in the inner loop of the most time sensitive thing imaginable, It won't matter.
Without testing it, I think it would be larger.
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

p2

Okes so now the updated (fixed) version: this code:
If X=2: 4->Y: 6->Z: End
should get the exact same results as this one:
If X=2: +3->Y: +2->Z: End
but the second one would even be a liiiitle bit slower and also bigger...? O.o

so modifying any code this is the rule I should follow?:
2->X: 4->Y // Don't change anything since it's just numbers
2->X: X+4->Y // Using a variable name twice here so modify to 2->X:+4->Y
SO this kind of "modification" only makes sense in very few situations since it's else just going to add even more stuff to process? :)
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Hayleia

I think the "+constant->Whatever" is only worth it if the constant is either -2, -1, 0, 1 or 2. Because in these cases, you just have 1 or two "dec" or "inc" so you save space and time, but in all other cases you're actually doing an addition which is more costly than just a load.
So you can probably keep your +2->Z but the +3->Y isn't an awesome idea. I don't recall if -3 and 3 are to add to the list, but at least don't do this with +7 or whatever :P

And obviously, when you have "Whatever->Variable:Variable+Whatever->Whatever", as you said, you can get rid of one of your "Variable"s.

p2

nice, thank you ^^ I think I now completely understood the use of the HL register  :thumbsup:
Next thing up for me to learn is ?X+2 and stuff...  :ninja:
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

ben_g

The ? is basically an inline if. If the expression before the ? returns true (iirc this equals to any nonzero number in axe), the code after the ? is executed.

Example:
If A=3
A++
End

Can also be written as

A=3?A++

You can also have a, to have an else condition.

The main advantage is that you can use it inline. For example to have a different sprite when a player is running or not: Pt-On(X,Y,Speed=0?°StandSPR,°RunSPR) This command functions similarly to this code:
If(Speed=0)
Pt-On(X,Y,°StandSPR)
Else
Pt-On(X,Y,°RunSPR)
End
However the first one only has one call to Pt-On. As for efficiency, I assume that performance-wise it's pretty much the same, but I think the first one compiles into slightly smaller code. I'm not sure of that though.

p2

Quote from: ben_g on September 14, 2016, 11:39:35 PM
You can also have a, to have an else condition.
Had to read it 3 times before I understood that one xD


Quote from: ben_g on September 14, 2016, 11:39:35 PM
The main advantage is that you can use it inline. For example to have a different sprite when a player is running or not: Pt-On(X,Y,Speed=0?°StandSPR,°RunSPR) This command functions similarly to this code:
If(Speed=0)
Pt-On(X,Y,°StandSPR)
Else
Pt-On(X,Y,°RunSPR)
End
I never knew this was possible I always thought it was only useful for having to write less code... But the inline usage is really cool *-* (Gonna give it a try and create a few examples how I think it orks xD)
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

E37

#84
The most efficient size way to do it is
:A-3??A++
Or
:A+(=3)->A
Note that the comma in the ? Or ?? Statements adds 3 bytes.
Another way to do the sprites is to
:PtOn(X,Y,°StandSPR- °RunSPR*(A=3)+°RunSPR)
That code assumes that RunSPR was declared before StandSPR.
Switch stand and run if stand was declared first.
That would work for any amount of data between the sprites. If they are right next to each other when declared you can replace °StandSPR- °RunSPR with 8 (and change the order to  A=3*8+°RunSPR to remove the parenthesis around a=3 you can change run to stand again if stand is declared first)
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

E37

  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

p2

I never knew there was such a list *-* thanks a lot ^.^
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Dream of Omnimaga

I think some of those are from the now defunct Omnimaga articles section, though, right? I know some of those had a backup copy on the forums but in the event where they don't, then you could check archive.org. Also Site du Zéro has an Axe tutorial but it's in French.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

E37

#88
I have an update to my previous post. It will be here and added to the big list for completeness.

Using Hex
[spoiler]
Here is some hex and examples to help optimize your code.
DispGraph: Asm(EF7150)
This is a much slower form of Axe's dispgraph. It will only be useful if you have never used dispgraph anywhere in the program.
It does give a very nice size reduction though.
If you know any assembly, it can be used to replace some Axe functions and you can gain in speed and size!
This goes especially well with the Mimas.
In libraries that require an axiom (like memkit), you can remove the axiom requirement and add inline hex instead.
I guess I should mention that there is nothing special about axioms. Anything that can be accomplished with axioms can be done with inline hex. (loops can get tricky though and you may need to some hacky things to add them - such as adding axe labels and passing the hex the address as an argument!)

Here are some cool things you can use...
:.some code
:Goto Gbd1HEX // this can also be a subroutine instead
:
:[] -> Gbd1HEX
:[*assembly code in hex here*]

This will result as the hex code being run as if you called it with Asm() !
[/spoiler]

Updates to Extras:
[spoiler]
$844C->CurCol
$844B->CurRow
These are the locations of the column and row of the cursor in the homescreen. Output(5,6) is the same as 5->curCol:6->curRow
[/spoiler]
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

Dream of Omnimaga

On a side note, although they are old, the Omni tutorials are back. @Soru only needs to re-add thr Php script for thr ones that were using actual topic post content.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Powered by EzPortal