Yes, restoring the default value of a string, that would help me out a whole lot times :D
Well if you use MirageOS, it has automatic copyBack, so anything you modify will stay modified. Maybe just make your program for MirageOS/Doors?
Yes, restoring the default value of a string, that would help me out a whole lot times :D
:If A=0:If B=0:Text(1,1,"COOL"):End:End
After commenting those lines out it worked fine again, but if I bring one back my sprites glitch up and more makes me get ERR:INVALIDs again. My game is rather huge, using like, 30 pictures, all the letter variables, and a bit of L1, so it makes me think it might have to do with free RAM or whatever? Mind you, it's not an Axe error but a TI error I'm getting, after trying to run the game. Oh, I see, that's the problem then. those commands push me right over 8192. Problem(s) solved, then!
How large is your program? Any Homescreen program that is over 8100 bytes will give an error, it sounds to me like you are very close to this value?
As for text, try putting a Fix 5 at the very start of your program
I believe this may be what you're looking for:
http://ourl.ca/4129/80803
http://ourl.ca/4129/81340
-- or this --
http://ourl.ca/4129/123530
http://ourl.ca/4129/125194
.NUMINP
0?F?B
Repeat F
0?K
Repeat K
Output(0,{E844B},'?'?Frac
getKey?K=9?F
End
K-1/10?A
4-A?A
If A=1
K^10-4*3+A?A
End
If A=2
K^10-6*3+A?A
End
If A=3
K-1^10-7*3+A?A
End
If K=33
0?A
End
If K?9
B*10+A?B?A
sub(A)
End
End
Return
Lbl A
[000000?Pic99
A?{Pic99}r
If {Pic99}r>9
1?{Pic99+2
End
If {Pic99}r>99
2?{Pic99+2
End
If {Pic99}r>999
3?{Pic99+2
End
If {Pic99}r>9999
4?{Pic99+2
End
For(A,0,{Pic99+2
Output(1+{Pic99+2}-A,{E844B},{Pic99}r^10+48?Frac
{Pic99}r/10?{Pic99}r
End
How large is your program? Any Homescreen program that is over 8100 bytes will give an error, it sounds to me like you are very close to this value?Builderboy, I think you were ninja'd by 9 hours XD
As for text, try putting a Fix 5 at the very start of your program
How large is your program? Any Homescreen program that is over 8100 bytes will give an error, it sounds to me like you are very close to this value?Builderboy, I think you were ninja'd by 9 hours XD
As for text, try putting a Fix 5 at the very start of your program
How large is your program? Any Homescreen program that is over 8100 bytes will give an error, it sounds to me like you are very close to this value?Builderboy, I think you were ninja'd by 9 hours XD
As for text, try putting a Fix 5 at the very start of your program
How large is your program? Any Homescreen program that is over 8100 bytes will give an error, it sounds to me like you are very close to this value?Builderboy, I think you were ninja'd by 9 hours XD
As for text, try putting a Fix 5 at the very start of your program
How could that happen? XD
I have yet another question. To use Axioms we need to know Assembly, right?
Er, just def (for a function). Sorry, I keep getting these languages mixed up :P
Serves me right for learning three languages in two days.
Er, just def (for a function). Sorry, I keep getting these languages mixed up :P
Serves me right for learning three languages in two days.
OOOOH Like a function written in Assembly code.
So it's like a subroutine but that can be written in Assembly, pure epic!
If A
stuff
Else
!If B
stuff
End
End
is the same asIf A
stuff
Else!If B
stuff
End
Code: [Select]If A
is the same as
stuff
Else
!If B
stuff
End
EndCode: [Select]If A
stuff
Else!If B
stuff
End
EndIf does what it sounds like...it Ends the loop If condition is true. Like ReturnIf, but for loops instead of subroutines.
I have a question: how to create a up/down or left/right moving platform in a tilemapper? i dont know how to do this...
Thanks in advance!
bumpIf you want an example in TI Basic, you can look at the code for "Stack'em Up" in my HGP: http://ourl.ca/4491/142729 ;D
anyone knowing the answer on m question?
...
[07:39:43] <aeTIos> Oh wait you should copy the whole tilemap to a list, Copy(Tilemap, L1-6,length tilemap)
[07:40:29] <aeTIos> and then you can write the new var to it with var->{position in list}
[07:41:13] <aeTIos> I hope that is clear. You have to draw the tilemap from the list, obviously.
...
quote from omnomirc:Quote...
[07:39:43] <aeTIos> Oh wait you should copy the whole tilemap to a list, Copy(Tilemap, L1-6,length tilemap)
[07:40:29] <aeTIos> and then you can write the new var to it with var->{position in list}
[07:41:13] <aeTIos> I hope that is clear. You have to draw the tilemap from the list, obviously.
...
Oops, nah, you can just do that this way: [hex]->tile
.Top Left
29-Osub(D8)+J*[map_width]+(45-Nsub(D8)+I)+E→r₆
.Top Right
Nsub(O00)→r₅+r₆
.Bottom Left
Osub(O00)*[map_width]+r₆→r₆
.Bottom Right
r₅+r₆
Lbl D8
/2/2/2
Return
Lbl O00
//2≠⁻2
Return
.Top Left
29-O/2/2/2+J*[map_width]+(45-N/2/2/2+I)+E
.Top Right
29-O/2/2/2+J*[map_width]+(51-N/2/2/2+I)+E
.Bottom Left
35-O/2/2/2+J*[map_width]+(45-N/2/2/2+I)+E
.Bottom Right
35-O/2/2/2+J*[map_width]+(51-N/2/2/2+I)+E
...Jsub*[map_width]What does that do? I thought sub( called a subroutine, but in the code there's no parenthesis or label pointer...
I kinda wondered about that...is there a way to force axe to see it as a negative number i.e. when using Disp ?
when using the Sin( function, depending on where it is used you can use the Sign{ command to convert a "Normal" negative number into input the function can read in the right context. Since -1 == 65535 in axe (if you're using a general purpose variables [all of which are 16 bit] such as vars A-Z and Theta) then the Sin( is calculating the sin of 65535. at least methinks. Even if it is doing it correctly, a Sign{ function never hurts, I know that for sure.
ummmm... ok. i sorta get it. well fortunately, i won't be dealing with anything over 65535, unless its negative. but in the event that it i do have to deal with the sin( of a negative number, is there some way to get a pointer to the ram where the A-Z and Theta variables are stored? (or even better, the pointer to a specific variable.)
For this:Here's the most optimized code I could come up with. Only while finding the top left corner does it fully calculate the position. The other corners reuse previously found values and conditionally add to them as necessary. Note that this will only work with the corner locations being calculated in the order below (although code can exist between calculations), and only for the player being at (45,29) due to optimizations tuned specifically to this coordinate.Code: [Select].Top Left
29-Osub(D8)+J*[map_width]+(45-Nsub(D8)+I)+E→r₆
.Top Right
Nsub(O00)→r₅+r₆
.Bottom Left
Osub(O00)*[map_width]+r₆→r₆
.Bottom Right
r₅+r₆
Lbl D8
/2/2/2
Return
Lbl O00
//2≠⁻2
ReturnThis is effectively what it does, only this is larger and slower.Code: [Select].Top Left
29-O/2/2/2+J*[map_width]+(45-N/2/2/2+I)+E
.Top Right
29-O/2/2/2+J*[map_width]+(51-N/2/2/2+I)+E
.Bottom Left
35-O/2/2/2+J*[map_width]+(45-N/2/2/2+I)+E
.Bottom Right
35-O/2/2/2+J*[map_width]+(51-N/2/2/2+I)+E
Also wow, this topic grew fast...
How does the float{} function work? I've tried it, but everything after float{X} returned an error...
For(F,0,767
{L3+F} or {L6+F}->{L6+F}
End
Also wow, this topic grew fast...
Edit: also, Can axe programs have already assembled programs be included in them?
the axe command list thread does. under many commands, the shortcut to reach them is listed.
Darl, if by list you mean a free RAM location (ie L1, L2, etc) then yes it is slightly faster and smaller to do that over a variable-location appvar. The difference isn't huge though, only a few cycles.
Ok, thanks :D
I'm guessing reading from the archive takes longer, but is it a large slowdown?
Yeah it is slower, but unfortunately it seems Runners documentation is lacking in that regards D:
A helpful optimization hint: always put constants last!
{P+A}: 11 bytes, 61 cycles
{L1+A}: 11 bytes, 55 cycles
{A+L1}: 10 bytes, 51 cycles
00 83 13 37 00 00 00 00 00
Okay, thanks.
Another question: How can you use the Parser hook in an Axe program (In other words, what is the hex opcode?)
:E90D3
:Asm(EF2650)
:Asm(EF2950)
EDIT:
I used memkit to get the name of a program in L1. How do I now do a GetCalc( for that program? I can't get a "prgm" before the name :S
input->S
it will ask for input, and store a pointer to that input in S. S can then be used as a string.
so i can treat it as a string? is there any way to store the output of "input" directly to a string?
Ah. Well here's a breakdown:I love pointers sometimes, hate them others. It's useful, and annoying (especially when using disp :P), but mostly useful :P
When you get as low-level as Axe, everything's stored as individual bytes. A variable (A-Z and theta) is 2 bytes (in Axe), a floating-poiint number is 9 bytes, etc. Your calculator has 32,768 bytes of RAM for you to work with. They're just stored one after the other, 32,768 in a row. There's no way to tell the bytes apart, so that's why each one is given an address.
Think of it this way: You've got 32,768 houses lined up in a row that look exactly identical. What really matters is what's in each house, which could be a number from 0 to 255. How do you tell them apart? By using addresses. Each address is a number between $8000 and $FFFF, and they all point to a distinct hou-- er, byte. Hence addresses are called pointers :)
You can literally store anything here, since they're all numbers anyway. You could represent a string as a sequence of bytes; maybe one particular string you need starts at address $C38E and runs to $C390 (three bytes). $C38E would be the pointer that points to the string.
And then since each pointer is just a number, you can store that in a variable too. The input simply asks the user to input a string, stores it to a string structure somewhere in RAM, and returns the pointer to (address of) the string. That's all that input→P does: it gets an input string, stores it somewhere, then stores the pointer to the string into variable P. You can then display the contents of that string by calling Disp P, for example.
(This is because Disp takes a pointer as an argument and displays the string starting at that address. When you do something like "HELLO"→GDB0:Disp GDB0, all that Axe does is stick the bytes of the string "HELLO" into the program memory and define GDB0 as the address of that string.)
Hope that helps (and hope that clears some stuff up for other people, too)!
but how would you store the "input" data to a string? would it be
input->p
copy(p,str1,length(p))
How many buffers are there, and how do I use them in Axe?
How do I create a program with GetCalc(? I can create appvars just fine, but trying to create a program crashes. (It really just freezes, actually.)Don't you get the prgm token from the catalog, then type the name of the desired program?
How do I create a program with GetCalc(? I can create appvars just fine, but trying to create a program crashes. (It really just freezes, actually.)Don't you get the prgm token from the catalog, then type the name of the desired program?
I don't think that there are any memory leaks, so long as you make sure you never do anything like goto from a subroutine to your main code.I can.
If you use 'goto' to jump to another subroutine, then as long as you return, there won't be any damage. As a general rule of thumb, you have to match each 'sub(' with a 'Return'.
Can somebody else confirm?
ooh!Naturally. ;)
Is it customizable?
If getKey
inData(,Data(stuff,0))->wherever
End
A bit easier to deal with, but idk how optimized it is:!If getcalc("appvarSPREDIT",Y1)
:Return
:End
...
:Copy(Y1+C,L1,64)
:For(F,0,3)
:Pt-On(F^2*8,F/2*8,F*8+L1)
:Pt-On(F^2*8,F/2*8,F*8+L1+32)r
:End
:DispGraphrr
I would like to remove the Copy( part of it though.Pt-on(_,_,_) can better be described Pt-on(_,_,{_})
Since the {} is implied in the command, it would look like this {F*8+C+{Y1}}
If I were to use Pt-on(_,_, F*8+C+Y1) It throws an error about filetype misuse.
/me curses as he tries it.
Caused an instant ram clear when run.
Edit: Did you try it on calc
I's just wondering, but when I tried to create appvar, there was something else called "u" created too along with my appvar "MYAPPVAR". When I tried to delete that "u", it caused instant calc reset. What is happening?
:"This"→Str00
:"is"→Str01
:"a"→Str02
:"test."→Str03
:Data(Str00ⁿ,Str01ⁿ,Str02ⁿ,Str03ⁿ)→Str0 . The pointers to each string
:Disp {A*2+Str0}ⁿ . Where A is the index of the string
what are the n's? I just looked through the catalog and didn't see anything like that...unless that's the ° or r ?Code: (Axe) [Select]:"This"→Str00
:"is"→Str01
:"a"→Str02
:"test."→Str03
:Data(Str00ⁿ,Str01ⁿ,Str02ⁿ,Str03ⁿ)→Str0 . The pointers to each string
:Disp {A*2+Str0}ⁿ . Where A is the index of the string
is pretty fast and can easily be modified in-program.
You saved me almost 3000 bytes!Code: (Axe) [Select]:"This"→Str00
:"is"→Str01
:"a"→Str02
:"test."→Str03
:Data(Str00ⁿ,Str01ⁿ,Str02ⁿ,Str03ⁿ)→Str0 . The pointers to each string
:Disp {A*2+Str0}ⁿ . Where A is the index of the string
is pretty fast and can easily be modified in-program.
You saved me almost 3000 bytes!Code: (Axe) [Select]:"This"→Str00
:"is"→Str01
:"a"→Str02
:"test."→Str03
:Data(Str00ⁿ,Str01ⁿ,Str02ⁿ,Str03ⁿ)→Str0 . The pointers to each string
:Disp {A*2+Str0}ⁿ . Where A is the index of the string
is pretty fast and can easily be modified in-program.
I love you <3
:"String here"→Str___
A zero byte is added to the end of the data automatically.
:"This"→Str000
:"is"→Str001
:"a"→Str002
:"test."→Str003
:Data(Str000r,Str001r,Str002r,Str003r)→Str0 . The pointers to each string
:Disp {A*2+Str0}r . Where A is the index of the string
So, it would work with that Data( line?
:"This"→Str00
:"is"[00]
:"a"[00]
:"test."[00]
:Data(Str00+0ʳ,Str00+5ʳ,Str00+8ʳ,Str00+10ʳ)→Str0
:Disp {A*2+Str0}ʳ
Thank you. Wish I didn't have to waste all those bytes though...
:"Bulbasaur"→Str000
:"Vsaur"
:[00]
:"Chucknorrissaur"
:[00]
:Data(Str000ʳ,Str000+10ʳ,Str000+16ʳ)
:"Bulbasaur"→Str000
:"Vsaur"→Str001
:"Chucknorrissaur"→Str002
:Data(Str000ⁿ,Str001,Str002)
Although where are these offsets coming from? The +19 and the +6?
EDIT: Side note, why do you use the ⁿ symbol in your code Deep Thought? Why not use the ʳ that I use? :P
→
˪
L₁
L₂
L₃
L₄
L₅
L₆
r₁
r₂
r₃
r₄
r₅
r₆
Y₁
Y₂
Y₃
Y₄
Y₅
Y₆
Y₇
Y₈
Y₉
Y₀
°
∆List(
≤
≥
≠
·
﹢
□
⁻¹
²
³
√(
³√(
ˣ√
ᴇ
ᵀ
ʳ
►Dec
►Frac
►Char
►DMS
►Tok
θ
α
β
γ
Δ
δ
ε
λ
μ
π
ρ
Σ
Φ
Ω
ṗ
χ
σ
τ
…
∠
⁄
ß
ˣ
ᴛ
◄
↑
↓
×
∫
√
ȳ
⋱
Code: [Select]◄
EDIT:Code: [Select]◄
When do you use that? ???
LUT Method Code: (Example) [Select] .Data
Final verdict: The fastest solution, and the smallest for a low number of strings. As the number of strings goes up, it will become larger than the search method and will consume many symbols, requiring you to start manually calculating the length of strings to put in the LUT. Suggested if speed is important or if using a low number of strings (≤18). | Search Method Code: (Example) [Select] .Data
Final verdict: Uses only 3 symbols without requiring the programmer to manually enter the length of the strings in a table. A smaller solution for a larger number of strings, but will quickly become many times slower than the LUT method with more and longer strings (e.g. getting the pointer to the name of a first generation Pokemon might take on average 20,000 cycles). Suggested if speed is not important for a larger number of strings (>18) or if you are tight on symbols and do not want to tally up the string lengths to put in a LUT. |
.Will have a terminating zero
"Test"→Str0
.Will not have a terminating zero
"Test"[]→Str0
.Data
[]→Str0
[04]"This"
[02]"is"
[01]"a"
[05]"test."
.Example call
2sub(SF)
.String fetching routine
Lbl SF
→r₁
Str0
Goto SF0
While 1
-1→r₁
r₂+{}+1
Lbl SF0
→r₂
End!If r₁
r₂
Return
Of course, you can't display such strings with the built-in routines. It's fairly simple to display char-by-char in a loop though.
.UNSQUISH
5->{L1}^^r
"0123456789ABCDEF"->GDB0
ClrHome
Disp "To unsquish: >prgm"
!If sub(INP)
Disp "Program not found!"
Return
End
->P
Disp "Save as:",[i],">prgm"
If sub(INP)
Disp "Program exists! Overwrite? (y/n)>"
Input ->R
!If {}-'Y'
Goto YES
End
!If -|E20
Goto YES
End
Return
End
Lbl YES
GetCalc(L1,{P-2}^^r->S*2)->Q
For(I,0,S-1)
{P+I}->J^16sub(GC)->{J/16sub(GC)->{I*2+Q}+1}
End
Disp "Program has beensuccessfully unsquished."
Return
Lbl GC
{+GDB0}
Return
Lbl INP
Fill(0->{(L1+1)},7)
Copy(Input ->I,L1+1,{I-2}^^r)
GetCalc(L1)
Return
:.PROGRAM
:[stuff]
:prgmPROGRAM2
:[more stuff]
Does Axe put a return after the sub-program, or do you have to put in the ret manually?
.POP
prgmPOPSTUP
prgmGKSRC
If pxl-Test(X,Y+5)
Return
End
Pt-On(20,55,[FFFFFFFFFFFFFFFF
Pt-On(X,Y,[FF42241800000000
End
1) Yes
2) If its 4 pixels tall, that means starting at the top left corner, there is a black pixel at Y+0,Y+1,Y+2, and Y+3, and there is white everywhere else. Y+5 will *not* trigger.
3) Return does not close the program if you are inside a subroutine, are you inside a subroutine?
.POP
prgmPOPSTUP
Repeat getKey(15)
prgmGKSRC
If pxl-Test(X,Y+4)
Return
End
Pt-On(20,55,[FFFFFFFFFFFFFFFF
Pt-On(X,Y,[FF42241800000000
End
..SETUP
Asm(EF4645EF7045FDCB00AE
..GETKEYS
DispGraphClrDraw
If getKey(1) and (Y<60
Y+2->Y
End
If getKey(2) and (X>0
X-2->X
End
If getKey(3) and (X<88
X+2->X
If getKey(4) and (Y>0
Y-2->Y
End
Could it be that you are clearing the screen right before you pixel test, and that there hasn't been anything drawn to the screen yet? Try doing the test after the sprite displays. And also, stick with +4, I didn't realize you were trying to detect the *other* sprite :)
If pxl-Test(X+3,Y+5
Return
End
If pxl-Test(X+4,Y+5 or ((pxl-Test(X+3,Y+5
Return
End
Why did you add the second pixel test command?
Actually Rect() is smaller, but since you still have the other Pt-On in your program, it still has the Pt-On subroutine and is *also* adding in the Rect() subroutine, making it larger. Also note that size doesn't necessarily have any correlation with speed, but smaller is in general faster.
rand^n generates a random number from 0 to N-1.
and you can have Lbl B and variable B and the program will have no issue :)
You can use rectI() (inverted rectangle) to make all sorts of fun effects. To make a white rectangle with black borders, simply draw a black rectangle and then an inverted one that is inside of it
If Y>=9 or (X<=71
//All getKeys code
End
if getkey(keycode)
If x/y (any) != (max/min for x/y value) ; choose the fitting one
x/y(any) +/-1 ->x/y ; idem
end
You should use:Code: [Select]if getkey(keycode)
If x/y (any) != (max/min for x/y value) ; choose the fitting one
x/y(any) +/-1 ->x/y ; idem
end
If getKey(1)
If X/Y != 71/9
X/Y +1 ->X/Y
End
.SCROLLJP ;Scroll-Jump :P
0→X
20→Y
Repeat getkey(15)
ClrDraw
If getKey(2)
X+1→X ;that cool arrow do you type with left-alt + 2 6
End
If getKey(3)
X-1→X
End
Pt-On(X,Y,[FF818181818181FF])
If X>88
Pt-On(X-96,Y,[FF818181818181FF])
End
If X=96
0→X
End
If X=666
Disp "The Game",imaginary i,"Never Gonna Give You up" ; Could not resist xD
If X≤65535
Pt-On(X+96,Y,[FF818181818181FF])
End
If X=65528
88→X
End
DispGraph
End
Return
Just change the sprites to the ones you need.
:..GETKEYS
:DispGraphClrDraw
:If getKey(1) and (Y<59
:Y+2→Y
:End
:If getKey(2)
:X-2→X
:End
:If X>88
:Pt-On(X-96,Y,[FE44381000000000
:End
:If X=96
:0→X
:End
:If getKey(3)
:X+2→X
:End
:If X≤65535
:Pt-On(X+96,Y,[FE44381000000000
:End
:If X=65528
:88→X
:End
:If getKey(4) and (Y>8
:Y-2→Y
:End
:..GETKEYS
:DispGraphClrDraw
:If getKey(1) and (Y<59
:Y+2→Y
:End
:If getKey(2)
:X-2→X
:End
:If X=96
:0→X
:End
:If getKey(3)
:X+2→X
:End
:If X=0
:88→X
:End
:If getKey(4) and (Y>8
:Y-2→Y
:End
rand^n
.THIS GENERATES A RANDOM NUMBER UP TO N-1
Think about it:
rand generates a number between 0 and 255.
Lbl RAN
...
Returns a random number from r1 to r2, excluding r2.
r3 is the increment.
...
r2-r1/r3
rand^
*r3+r1
Return
You'll have to put the second argument to the ^ operator after it (the omission trick only works for the first argument of an operator)Code: [Select]Lbl RAN
...
Returns a random number from r1 to r2, excluding r2.
r3 is the increment.
...
r2-r1/r3
rand^
*r3+r1
Return
I think that works?
Yep, remember ^ (modulus) is just the remainder after division, so if it's zero, there is no remainder (it's divisible).
:If X=88 or (Y=62 or (X=65532 or (pxl-Test(X-1,Y+2 or (pxl-Test(X-1,Y+3 or (pxl-Test(X-1,Y+4 or (pxl-Test(X,Y+1 or (pxl-Test(X,Y+5 or (pxl-Test(X+1,Y+1 or (pxl-Test(X+1,Y+6 or (pxl-Test(X+2,Y or (pxl-Test(X+2,Y+7 or (pxl-Test(X+3,Y+8 or (pxl-Test(X+4,Y-1 or pxl-Test(X+4,Y+8 or (pxl-Test(X+5,Y or (pxl-Test(X+5,Y+8 or (pxl-Test(X+6,Y or (pxl-Test(X+6,Y+8 or (pxl-Test(X+7,Y+8 or (pxl-Test(X+8,Y or (pxl-Test(X+8,Y+3 or (pxl-Test(X+8,Y+4 or (pxl-Test(X+8,Y+5 or (pxl-Test(X+8,Y+7
:If X=88 or (Y=62 or (X=65533 or (pxl-Test(X+8,Y) or (pxl-Test(X+8,Y+7 or (pxl-Test(X+6,Y+1 or (pxl-Test(X+2,Y or (pxl-Test(X+7,Y+8 or (pxl-Test(X+7,Y-1 or (pxl-Test(X+2,Y+7 or (pxl-Test(X+3,Y+8 or (pxl-Test(X+4,Y+8 or (pxl-Test(X,Y+3
You should write a for loop for the pxl-test.
0->Z
For(A,0,7
Z+Pxl-Test(X,Y+A)->Z
End
If Z!=0
blah blah
end
:If X=88 or (Y=62 or (X=65532 or (pxl-Test(X-1,Y+2 or (pxl-Test(X-1,Y+3 or (pxl-Test(X-1,Y+4 or (pxl-Test(X,Y+1 or (pxl-Test(X,Y+5 or (pxl-Test(X+1,Y+1 or (pxl-Test(X+1,Y+6 or (pxl-Test(X+2,Y or (pxl-Test(X+2,Y+7 or (pxl-Test(X+3,Y+8 or (pxl-Test(X+4,Y-1 or pxl-Test(X+4,Y+8 or (pxl-Test(X+5,Y or (pxl-Test(X+5,Y+8 or (pxl-Test(X+6,Y or (pxl-Test(X+6,Y+8 or (pxl-Test(X+7,Y+8 or (pxl-Test(X+8,Y or (pxl-Test(X+8,Y+3 or (pxl-Test(X+8,Y+4 or (pxl-Test(X+8,Y+5 or (pxl-Test(X+8,Y+7
8
While 1
-1→T .that's a subtraction sign
{+Pic0}→U
8
While 1
-1→S
If U^2
If pxl-Test(X+S,Y+T)
Goto COL
End
End
U/2→U
End!If S
End!If T
Repeat getKey(15)
...
End
Pt-On(X,Y,Pic1
DispGraph
Pt-Change(X,Y,Pic1
DRAW TUNNEL
Pt-On(X,Y,Pic1
DispGraph
Pt-Change(X,Y,Pic1
COLLISION
SHIFT SCREEN
DRAW TUNNEL
COLLISIONS
SHIFT SCREEN
Pt-On(X,Y,Pic1
DispGraph
Pt-Change(X,Y,Pic1
DRAW TUNNEL
COLLISIONS
Pt-Change(X,Y,Pic1
DispGraph
Pt-Change(X,Y,Pic1
SHIFT SCREEN
:.VOYAGERX
:Fix 5
:DelVar A
:0→A→S
:Full
:ClrHome
:ClrDraw
:31→Y
:[0000000000000000]→Pic0
:[10587EFD7E581000]→Pic1
:[F87E1B79791B7EF8]→Pic3
:[387C7EFFFFFF7E30]→Pic2
:[1E3F1EFDFD1E3F1E]→Pic4
:0→T
:DrawF (20,20,"VOYAGER X")
:
:
:
:
:
:Repeat T>0
:If getKey(34)
:1→T
:End
:If getKey(26)
:2→T
:End
:If getKey(18)
:3→T
:End
:End
:ClrDraw
:Repeat getKey(15)
:S+1→S
:Text(0,,S►Dec)
:Pt-Off(0,Y,Pic0)
:Horizontal -
:Horizontal -
:If pxl-Test(5,Y) or pxl-Test(6,Y+1) or pxl-Test(8,Y+2) or pxl-Test(9,Y+3) or pxl-Test(8,Y+4) or pxl-Test(6,Y+5) or pxl-Test(5,Y+6)
:If S>H
:S→H
:End
:Return
:End
:If pxl-Test(4,Y) or pxl-Test(5,Y+1) or pxl-Test(7,Y+2) or pxl-Test(8,Y+3) or pxl-Test(7,Y+4) or pxl-Test(5,Y+5) or pxl-Test(4,Y+6)
:If S>H
:S→H
:End
:Return
:End
:If rand^14-T=1
:rand^45+9→B
:Pt-Off(86,B,Pic2)
:End
:If getKey(4)
:If Y≥11
:Y-T→Y
:End
:End
:If getKey(1)
:If Y≤52
:Y+T→Y
:End
:End
:If T=2
:Pt-On(0,Y,Pic1)
:End
:If T=1
:Pt-On(0,Y,Pic3)
:End
:If T=3
:Pt-On(0,Y,Pic4)
:End
:DispGraph
:End
Basically, Text( lets you set the coordinates before displaying text, while Text uses the current coordinates and takes only a single argument (the string).
1st Pass: 19%Source code:
ERR: BAD SYMBOL
.KEY
While 1
getKey->K
If K=25:Then
Disp getKey(K)
End:End
What's wrong?I have a question, what is the x256 mode and can someone give me an example?256 mode?? Whoa.
I have no idea of how to use it and would like to learn, can I have a sample? Thanks
Its not a mode, but more like a style of programming that gives you more precision. The idea is that you multiply your position variables by 256 to give you a screen that is 256 times as big (and consequently has a *lot* more possible positions and a lot more precision) and then when you display your sprites you "zoom" back out by dividing by 256.Maybe I can fix my engine's "/\" jump. Not before I get a freaking tilemap routine./me has lost several brain cells trying to tilemap.
This has been written about a lot, I'm sure there has got to be a tutorial about this somewhere, or at least a more in depth explanation.
Is it a scrolling tilemap?Yes. I saw the tutorial, but it's hard to implement in a platformer game.
0→Y
5→X
Repeat getKey(15)
ClrDraw
Line(0,63,95,63)
Pxl-On(X,Y/256)
If (pxl-Test(X,Y+1)=0)
Y+128→Y
End
DispGraph
End
pxl-Test(X,Y+1) should be pxl-Test(X,Y/256+1)
Also you can save a lot of memory by doing !If pxl-Test(X,Y/256+1) instead of If (pxl-Test(X,Y/256+1)=0).
Yes, it is. The advantage to having x256 is that you can have the object move at partial speeds (such as one pixel every three frames for the illusion of 33% speed). pxl-Test( and all those other commands still treat it as if it were a multiple of 256, but this way you can have one object moving one pixel every frame and another at a fraction of that speed.
.Y of the sprite
0→Y
.X of the sprite
0→X
.X Acceleration of the sprite
0→A
.Y Acceleration of the sprite
0→B
Repeat getKey(15)
ClrDraw
If getKey(2)
A-128→A
End
If getKey(3)
A+128→A
End
Line(0,63,95,63)
X+A→X
Y+B→Y
Pxl-On(X/256,Y/256)
If (pxl-Test(X,Y+1)=0)
Y+128→Y
End
DispGraph
End
[FFFFFF->Str1
[010203
[More hex
[504432]
and[FFFFFF
[010203
[More hex
[504432]->Str1
[0102
"Foobar"
Data(42)->Str1
How does the compiler know the limits of the block of memory?
It occurred to me that I'm treating memory almost as magic in some cases.
So, some questions.
What's the difference between doingCode: [Select][FFFFFF->Str1
and
[010203
[More hex
[504432]Code: [Select][FFFFFF
[010203
[More hex
[504432]->Str1
If want to load a large amount of memory (using hex, strings or Data()) on multiple lines, how does Axe know when the block of memory ends? For example, if I haveI'm not quite sure what you mean? You have defined 51 bytes in that code, and so Axe adds those 51 bytes into your program.Code: [Select][0102
How does the compiler know the limits of the block of memory?
"Foobar"
Data(42)->Str1
If want to load a large amount of memory (using hex, strings or Data()) on multiple lines, how does Axe know when the block of memory ends? For example, if I haveI'm not quite sure what you mean? You have defined 51 bytes in that code, and so Axe adds those 51 bytes into your program.Code: [Select][0102
How does the compiler know the limits of the block of memory?
"Foobar"
Data(42)->Str1
[FFFFFF]->Str1
[010203]
[HEX000]
[FFFFFF]
or[FFFFFF->Str1
[010203
[HEX000
[FFFFFF]
?
.Y of the sprite
0→Y
.X of the sprite
0→X
.X Acceleration of the sprite
0→A
.Y Acceleration of the sprite
0→B
Repeat getKey(15)
ClrDraw
If getKey(2)
A-128→A
End
If getKey(3)
A+128→A
End
Line(0,63,95,63)
X+A→X
Y+B→Y
Pxl-On(X/256,Y/256)
!If (pxl-Test(X/256,Y/256+1))
Y+128→Y
End
DispGraph
End
!If Y/256
0->A->B
End
I seriously don't get this, in most of my programs I use X+2->X and sometimes even 3. In order to avoid skipping vertical lines I usually check if (X<88) and (X<87) and stuff like that.
Either way, I am using Axe 0.5.2, but perhaps it was not the program's problem, I shall try again.
512→Y
12288→X
0→A→B
Repeat getKey(15)
ClrDraw
Line(0,63,95,63)
Pxl-On(X/256,Y/256)
If getKey(2)
A-8→A
End
If getKey(3)
A+8→A
End
If getKey(4)
B-8→B
End
!If (pxl-Test(X/256,Y/256+1))
B+1→B
End
X+A→X
Y+B→Y
DispGraph
End
512→Y
12288→X
0→A→B
Repeat getKey(15)
ClrDraw
Line(0,63,95,63)
Pxl-On(X/256,Y/256)
If getKey(2)
A-8→A
End
If getKey(3)
A+8→A
End
If getKey(4)
B-8→B
End
!If (pxl-Test(X/256,Y/256+1))
B+1→B
End
<add this>
If (pxl-Test(X/256,Y/256+1))
0->B
End
</add this>
X+A→X
Y+B→Y
DispGraph
End
Its because you are increasing the velocity of B when you collide. You want it to stop right? Try 0->B instead of B+1->B
How many bytes is an 8x8 monochrome sprite?
There's not code for stopping.
try this:Code: [Select]512→Y
12288→X
0→A→B
Repeat getKey(15)
ClrDraw
Line(0,63,95,63)
Pxl-On(X/256,Y/256)
If getKey(2)
A-8→A
End
If getKey(3)
A+8→A
End
If getKey(4)
B-8→B
End
!If (pxl-Test(X/256,Y/256+1))
B+1→B
End
<add this>
If (pxl-Test(X/256,Y/256+1))
0->B
End
</add this>
X+A→X
Y+B→Y
DispGraph
End
Also, you should put a terminal velocity in, such as B can't be greater than 256. ;)Its because you are increasing the velocity of B when you collide. You want it to stop right? Try 0->B instead of B+1->B
actually, that's his fall code. ;) note the "!"
.C
512→Y
12288→X
0→A→B
Repeat getKey(15)
ClrDraw
Rect(0,0,96,64)
RectI(3,3,90,58)
Line(0,30,40,30)
Rect(X/256,Y/256,8,8)
If getKey(2)
A-16→A
End
If getKey(3)
A+16→A
End
X+A→X
Y+B→Y
If (pxl-Test(X/256+8,Y/256))
0→A
End
If (pxl-Test(X/256-1,Y/256))
0→A
End
If (pxl-Test(X/256,Y/256+8))
0→B
End
!If (pxl-Test(X/256,Y/256+8))
B+4→B
End
If getKey(4)
B-16→B
End
DispGraph
End
.C
512→Y
12288→X
0→A→B
Repeat getKey(15)
ClrDraw
Rect(0,0,96,64)
RectI(3,3,90,58)
Line(0,30,40,30)
Rect(X/256,Y/256,8,8)
If getKey(2)
A-16→A
End
If getKey(3)
A+16→A
End
X+A→X
Y+B→Y
If (pxl-Test(X/256+8,Y/256)) or (pxl-Test(X/256-1,Y/256))
0→A
End
If (pxl-Test(X/256,Y/256+8))
0→B
End
!If (pxl-Test(X/256,Y/256+8))
B+4→B
End
If getKey(4)
B-16→B
End
DispGraph
End
I have a huge problem in Axe, I can't avoid that my sprites go through walls or even the floor when they are in fast speeds. Is there any way to avoid this?
Main Loop
For({<insert pointer here>},0,1)
...
End
DispGraph
End
Another thing to do is only redraw the screen every other frame.
!If A+1^2->A
DispGraph
End
Actually, the slowest Axe command (that won't freeze the calculator altogether) is Pause 0, which would take about 220 million cycles. That's a bit over half a minute at 6MHz. ;)
Why does my application sometimes randomly defragment itself when exiting it?An unsigned application deletes itself after 30 starts. You have 30 new starts after recompiling your project.
Oh I see
Didnt work
EDIT:: deleting I want to write over it
Avoid double posting in a 10-minute time, please edit your posts in the "Modify" or in the "Quick Modify" button.
But does it also count to the executable code? I mean, can you for example have 8000 bytes exec code and 13000 bytes of data?Both data and code have to be under 16k together, your data is written directly into the app.
Can I use Lists (no, not arrays) the same way in Axe as in Basic or I need to use Arrays? ThanksI wonder what do you need it for?
Is the second Rect() supposed to be a RectI()? And that Rect()r gets overwritten by the StorePic anyway.
The reason that It's going black is because immediately after you display the greyscale, you copy the back buffer to the front buffer, rendering the second frame b/w because the contents of the front buffer match the back buffer, so it's either 00 or 11 for every single pixel
Well, what's going on is that StorePic and RecallPic make L3 and L6 the same, so it's still greyscale, but all the greyscale routine sees is black pixels and white pixels. Remove the RecallPic or draw some more on the back buffer to fix it.
Does it display as grey initially?
It'll keep doing that so long as you have that RecallPic in there. What's the RecallPic for, anyway?
Note that if you are using greyscale, you *can't* backup images using Store and Recallpic, because those store to the backbuffer, which is used in greyscale. Remember, to display greyscale, it uses both L3 and L6. When you StorePic, you store the image to L3, which is not the right place to backup an image if you want to do greyscale
He wants to laterally flip it, not invert it i think.Ah, I see.
RectI()?Not invert the pixels, but flip them. Like, 11100001 would become 10000111
What are you looking to use this for?A way to flip the screen 180owith an animation, and b/c there doesn't seem to be a plausible way of making the screen look like it's rotating...
If (X-Z+3≤6) and (Y-θ+3≤6)
.Sprites are overlapping
End
If (X-Z+4≤8) and (Y-θ+4≤8)
.Sprites are touching
End
0
While 1
→Q
;Put your code here
End!If Q+1
And here's touching:Code: [Select]If (X-Z+4≤8) and (Y-θ+4≤8)
.Sprites are touching
End
If (X-C+4<=8) and (Y-E+4<=8)
Return
End
24→C
24→E
Repeat getKey(15)
If (X-C+4<=8) and (Y-E+4<=8)
Return
End
.MORE COLLISIONS
.GETKEYS FOR THE MAIN SPRITE
.DRAW FLAG
Pt-On(C,E,Pic1)
.THE MAIN SPRITE
Rect(X/256,Y/256,4,4)
.DISPLAY IT ALL
DispGraph
End
Can I do
{byte}>number?
And can I do
{byte}+n>m?
Can I do
{byte}>number?
And can I do
{byte}+n>m?
Both constructions are possible. Note: m<{byte}+n would always return not zero, since it will be processed from left to right.
Can I do
{byte}>number?
And can I do
{byte}+n>m?
Both constructions are possible. Note: m<{byte}+n would always return not zero, since it will be processed from left to right.
Unless N is zero...
Can I do {byte}->VAR, or does it have to be two bytes?
The nice thing about Java is that because almost everything is a pointer (primitives aren't), you don't need both.:)
.CHANGE VALUE OF APPVAR
"appvTest"→Str9
UnArchive Str9
GetCalc(Str9)→P
3000→S
If P
If S>{P}r
S→{P}r
End
End
Hi, I'm really new to this. I'm trying to change the value of an appvar from another program. The appvar already exists and was created by another program, it is currently placed in Archive. So this is what I've been doing:Code: [Select].CHANGE VALUE OF APPVAR
"appvTest"→Str9
UnArchive Str9
GetCalc(Str9)→P
3000→S
If P
If S>{P}r
S→{P}r
End
End
Then I compiled this for MirageOS. After selected and ran the program, I went into the original program that created appvTest and see whether the appvar has changed, and it still has the same value. Can you help me, please? Thank you.
Lbl O
< (r2+6) and (r1+6 > r3 and (r3+6 > r1 and (r4+6 > r2
Return
Lbl W
-> {r2 + 4 / 8 * 60 + (r1 + V + 4 / 8) + L3 + J }
Return
Lbl O
-r₂+5<11 and (r₁-r₃+5<11)
Return
Lbl W
→{r₂+4/8*60+(r₁+V+4/8)+J+L₃}
Return
Lbl O
Return!If -r₂sub(O0)
r₃-r₁
Lbl O0
+5<11
Return
Lbl W
→{r₂sub(W0)*60+(r₁+Vsub(W0))+J+L₃}
Lbl W0
*64+256/512
Return
Lbl W
→{r₂sub(W0)*10*6+(r₁+Vsub(W0))+J+L₃}
Return
Lbl W0
/2/2+1/2
Return
Axe does automatically round off numbers by dividings. That causes a difference between X + 4 / 8 and X / 2 / 2 + 1 / 2.I don't think there should be a difference between the three. Are you sure that there was one?
* 64 + 256 / 512 seems fine though, thanks. :)
Axe does automatically round off numbers by dividings. That causes a difference between X + 4 / 8 and X / 2 / 2 + 1 / 2.Well, X+4/4 is the same as X/2/2+1 though.
* 64 + 256 / 512 seems fine though, thanks. :)
.T
ClrHome
For(F,0,500)
If (Fsub(A)) - (Fsub(B))
Output(0,,F>Dec
End
End
sub(A)
+4 / 8
Return
sub(B)
/2/2+1/2
Return
If inData(A,Data([num here],[another num],[etc],0))
...return as true?Under what conditions does...Code: [Select]If inData(A,Data([num here],[another num],[etc],0))
...return as true?
I made a little test program and it works fine, but when I put it into the source for Shift--taking out If D=2 or (D=3) and replacing it with If inData(D,(2,3,0))--it seems to always output true ???
inData(D,Data(2,3,0))
If D-2<2
.D is 2 or 3
End
!If D/2-1
.D is 2 or 3
End
!If {L5 + 22} + 1 . Check if that byte is 255
equal to!If {L5 + 22} - 255 . Check if that byte is 255
?L1 = 714 bytes (saveSScreen) Volatility: LOW
L2 = 531 bytes (statVars) Volatility: LOW (Do not use this area when custom interrupts are enabled, including Mirage OS)
L3 = 768 bytes (appBackUpScreen) Volatility: MED (Saving to back-buffer will corrupt)
L4 = 256 bytes (tempSwapArea) Volatility: MED (Corrupt when archiving/unarchiving in program)
L5 = 128 bytes (textShadow) Volatility: MED ("Disp","Output", and "ClrHome" will corrupt)
L6 = 768 bytes (plotSScreen) Volatility: HIGH (Any buffer drawing will corrupt)
If 20 - {E} -> {E} > 10
return something wrong or rather something other than20 - {E} -> {E}
If {E} > 10
or is it just me? Is the upper code not working because the TI needs already HL for taking the E'th byte from the RAM?
If {20-{E}→{E}}>10
The Commands.htm file included in Axe releases has a pretty good summary of the L1-L6 RAM areas. And you can save data to any section of RAM you want. The question is what it will corrupt.Quote from: Commands.htmL1 = 714 bytes (saveSScreen) Volatility: LOW
L2 = 531 bytes (statVars) Volatility: LOW (Do not use this area when custom interrupts are enabled, including Mirage OS)
L3 = 768 bytes (appBackUpScreen) Volatility: MED (Saving to back-buffer will corrupt)
L4 = 256 bytes (tempSwapArea) Volatility: MED (Corrupt when archiving/unarchiving in program)
L5 = 128 bytes (textShadow) Volatility: MED ("Disp","Output", and "ClrHome" will corrupt)
L6 = 768 bytes (plotSScreen) Volatility: HIGH (Any buffer drawing will corrupt)
I thought you need {E8447}^r?
You don't need a r, the contrast is a 1-byte value. I think it's not appearing to work correctly because the value stored at 0x8447 isn't the value actually sent to the LCD driver. When adjusting the contrast, the value the OS sends to the LCD driver is the byte stored at this address plus 24. So to set a contrast one higher than the current OS contrast, you would do:
Shade({ᴇ8447}+24+1)
DelVar "prgmNAME"
Returns the bitwise operation of the lower 8 bits of the expressions. You often need parenthesis on the second argument when used.
I think the reason bitwise expressions work in if statements is because it's only manipulating one bit. They're essentially doing the same thing, iirc.
.RANDTXT
"0123456789-+/*^,()"→Str0
{Str0}+rand^18→Str1
Disp Str1
{Str0+rand^18}→Str1
? or would it be better if I try to do thisPlease note that because Axe uses left to right order of operations that code isn't doing what you want. It's doing {(Str0+rand)^18}->Str1 though you probably want {rand^18+Str0}->Str1 . In addition, I'm pretty sure you want {Str1} instead of just Str1 . Good luck with your program! :)Code: [Select]{Str0+rand^18}→Str1
?
Make a string with the byte at rand^18 of the string Str0 is pointing to and reference it with Str1?
.RANDTXT
[00000000000000000000000000000000]→Str1
"0123456789-+/*^,()"→Str0
For(I,1,16
{rand^18+Str0}→{Str1+2I-2}
End
Disp Str1
The code from before you edited it, meaning the code with {Str1+I-1}, works correctly.That meaning, it displayed the string fine, and quit without a cinch.
.ATEST
.[00000000000000000000000000000000]→Str1
Zeros(32)→Str1
.Zeros() does the same thing, but it's easier to code in in this case :P
.worked with initial bunch of 00s as well
"0123456789-+/*^,()"→Str0
For(I,0,15)
{rand^18+Str0}→{Str1+I}
.counting from zero is usually more efficient, in this case the -1 is omitted
End
ClrHome
Disp Str1
Repeat getKey(15)
.wait until clear is pressed
Pause 10
End
Worked without a problem for me.
The reason I edited to {Str1 + 2I - 2} was because each byte in the string with 16 letters represents a letter. So if I=1, position in the string (p) is 0; I=2, p=2, I=3, p=4 and so on. 2I-2 is the order of the 'th' in the string as 'I' increases.You can't use implicit multiplication in Axe. The correct way to do it is {I*2+Str1-2}.
I tried to put Pause 1900 at the end of the code and ran the program, the program paused for a while but still doesn't display anything.
Input is really buggy, personally I'd only use it as a last resort. You'd probably be better off making your own input routine :P (or use one from the routines thread, such as this (http://ourl.ca/4129/170416) from the routines thread)
.GUESS
"GUESS THE NUMBERüStr1
"TOO HIGH!üStr1H
"TOO LOW!üStr1L
"YOU WIN!üStr1W
DiagnosticOff
Lbl MN
ClrHome
Disp Str1
rand→B
While B-9→B>9:End
Lbl M
sub(1)
If K=15
ClrHome
Return
End
If A>B
Disp Str1H,i
Goto M
End
If A<B
Disp Str1L,i
Goto M
End
Disp Str1W,i
Pause 2000
ClrHome
Return
Lbl 1
0→A
getKey→K
If K=36:7→AEnd
If K=35:4→AEnd
If K=34:1→AEnd
If K=28:8→AEnd
If K=27:5→AEnd
If K=26:2→AEnd
If K=20:9→AEnd
If K=19:6→AEnd
If K=18:3→AEnd
ReturnIf K=15
ReturnIf A not equal to 0
Goto 1
The "While B-9→B>9:End" limits the number to 0-9.
.INPUTNO
"Input Number"→Str0
ClrHome
Disp Str0
sub(I)
Disp A,i
If getKey(15)
ClrHome
End
Lbl I
0→A
getKeyüK
Repeat getKey(9)
If K=36:7→{length(A)+A}
If K=35:4→{length(A)+A}
If K=34:1→{length(A)+A}
If K=28:8→{length(A)+A}
If K=27:5→{length(A)+A}
If K=26:2→{length(A)+A}
If K=20:9→{length(A)+A}
If K=19:6→{length(A)+A}
If K=18:3→{length(A)+A}
End
Goto I
if I have an infinite loop in my application, is there a quit button like ON in Basic? and not having to take out the batteries?No, there is no quit button (unless you program one yourself).
.INPUT
Zeros(6)→N
0→A
"Input number:"→Str0
Disp Str0,i
sub(I)
If K=15
ClrHome
Return
End
If K=9
Disp N>Dec,i
End
Lbl I
getKeyüK
If K=36:7→{N+A}End
If K=36:7→{N+A}End
If K=35:4→{N+A}End
If K=34:1→{N+A}End
If K=28:8→{N+A}End
If K=27:5→{N+A}End
If K=26:2→{N+A}End
If K=20:9→{N+A}End
If K=19:6→{N+A}End
If K=18:3→{N+A}End
A++
ReturnIf K=15
ReturnIf length(N)=3
ReturnIf K=9
Disp N>Dec,i
Goto I
Goto A would jump to Lbl A. Repeat getKey(15):End waits until the user presses clear.Actually, Runer wrote a library (http://ourl.ca/4129/155369) that lets you add, subtract and display 3 byte numbers.
As for the code, A is always increased, not just when a key is pressed. What might work is checking if the byte is non-zero, after the byte is stored.
Also I would change lines like this If K=36:7?{N+A}End to If K=36:7?{N+A}:End. There's more optimized ways to handle it, but the way you have it works enough.
Btw numbers in axe/asm can only be up to two bytes. trying to make a three-byte number won't work.
Axe is a lot less complicated than asm, but has some of the same concepts (pointers, data, etc)
You could store the values 0.00 to 655.35 in two bytes if you multiplicate your values by 100.
Displaying them correctly would be possible with an own displaying routine.
Furthermore Axe supports access to the floating-point variables of the OS afaik. Just take a look at the commands list. :)
Nah, I think he meant what he said. I'm pretty sure he was giving an example with 100 as an arbitrary number.You could store the values 0.00 to 655.35 in two bytes if you multiplicate your values by 100.
Displaying them correctly would be possible with an own displaying routine.
Furthermore Axe supports access to the floating-point variables of the OS afaik. Just take a look at the commands list. :)
Perhaps you mean 0.0 to 255.255? 655.35 wouldnt work so well as a FP high limit, considering the decimal part and integer part are both 8 bits.
.PAST
sub(PAS,5)
Lbl PAS
1->C
1->K
r1-K->B
sub(EXC,r1)
A->C
Disp C>Dec,i
sub(EXC,K)
C/A->C
Disp C>Dec,i
sub(EXC,B)
C/A->C
Disp C>Dec,i
Return
Lbl EXC
1->A
For(I,1,r1
A*I->A
End
Return
sub(EXC,3)
Disp A>Dec,i
Advice: Don't use axe 1.0.0 or 1.0.1 as of now, they have a pretty good bug that killed my calculator (still trying to fix it).
Your problem is that you don't quit the program after calling sub(PAS). Then the programm will pass this function twice -> you get it displayed 6 times.
put a return after
sub(PAS,5)
Your mixing your bases with 255.255, as that number is beyond Axe's precision in decimal and out of bounds in hex. What you're looking for is 0xFF.FF, 255+(255/256) in decimal.
It's not the representation Axe uses though. So whether or not it can be correct in other situations, I don't want people using it in Axe and then being helplessly confused when their program acts strange.
Well, then you lose the speed advantage present in 8.8 fixed point notation.
How about EFF.FF ?
.PASCAL
ClrHome
sub(PAS,5)
Disp L1>Dec
Return
Lbl PAS
1->{L1}
1->C
For(J,1,r1
r1-J->B
sub(EXC,r1
A->C
sub(EXC,J
C/A->C
sub(EXC,B
C/A->C
C->{L1+J}
End
Return
Lbl EXC
1->A
For(I,1,r1
A*I->A
End
Return
Lbl PAS
ClrHome
For(J,0,r1
r1-J->B
sub(EXC,r1
A->C
sub(EXC,J
C/A->C
sub(EXC,B
C/A->C
C->{L1+J}
Disp C>Dec,i
.Imaginary ^
End
Return
Lbl 001
getKey->K
If K=15
.QUIT
Return
./QUIT
End
If K=33:N*10+0->NEnd
If K=34:N*10+1->NEnd
If K=26:N*10+2->NEnd
If K=18:N*10+3->NEnd
If K=35:N*10+4->NEnd
If K=27:N*10+5->NEnd
If K=19:N*10+6->NEnd
If K=36:N*10+7->NEnd
If K=28:N*10+8->NEnd
If K=20:N*10+9->NEnd
If N<10
Output(1,1,N>Dec)
Else
Return
End
Goto 001
Lbl 001
getKey->K
ReturnIf K=15
If K //if K is not 0
N*10+inData(K,Data(33,34,26,18,35,27,19,36,28,20,0))-1->N
End
If N<10
Output(1,1,N>Dec)
Else
Return
End
Goto 001
This is probably very stupid to ask, but I find myself learning Axe very slowly. I read through the document and I read tutorials on Axe. But when I read codes from open source Axe programs, I have to spend a really long time to figure out what it does, most of the time, I can't figure out either. So I'd like to ask how you learned Axe at the beginning and how did you progress to this stage?
Both are the same size: 0 bytes.They're 2-3 bytes including the End, right?
2 or 3 bytes with End, 4 or 5 bytes with EndIf or End!If. But While 1 and Repeat 0 themselves result in 0 bytes of compiled code. ;)Ok thanks, that's what I needed.
{{1,1,1,1,1,1},{1,0,0,0,0,1},{1,0,0,0,0,1},{0,0,0,0,0,0}}➝matrix
But I don't know if this is possible on the Ti-83+.I have a question. I have just started in axe and I never programmed on the z80 calcs really before. I am used to in 68k basic to use matrices as a way to save map data. Something like this:Well, Axe doesn't technically support matrices, everything used to store data is an array of bytes.Code: [Select]{{1,1,1,1,1,1},{1,0,0,0,0,1},{1,0,0,0,0,1},{0,0,0,0,0,0}}➝matrix
But I don't know if this is possible on the Ti-83+.
Maybe axe doesn't support it...
Also if it would be possible is there a limit, or can I have huge matrices? Thanks in advance. :)
[010101010101]
[010000000001]
[010000000001]
[000000000000]➝pointer
Data(1,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0)➝pointer
{Y*Width+X+pointer}
Where Y is your Y-coordinate, X is your X-coordinate, and Width is the width of the map, and pointer is the pointer to your map data.
Hey guys, sorry for my english because i am french, but can some one explain me how to use the link port, how to send some variable, files, to make a multiplayer game.
Thank's
Send(BYTE,TIME) | Tries to send the byte across the linkport. It will keep trying until the other calculator receives the byte or time runs out. Returns 1 if the byte was sent successfully or 0 if it timed-out. Time is in the order of microseconds. |
Get | Checks if the sender is trying to send anything. Returns the byte if it was received or -1 if nothing was sent. No waiting is done. |
So If I didn't make a mistake here, this should draw (a part of the map) to fill the screen?I have a question. I have just started in axe and I never programmed on the z80 calcs really before. I am used to in 68k basic to use matrices as a way to save map data. Something like this:Well, Axe doesn't technically support matrices, everything used to store data is an array of bytes.Code: [Select]{{1,1,1,1,1,1},{1,0,0,0,0,1},{1,0,0,0,0,1},{0,0,0,0,0,0}}➝matrix
But I don't know if this is possible on the Ti-83+.
Maybe axe doesn't support it...
Also if it would be possible is there a limit, or can I have huge matrices? Thanks in advance. :)
There are a couple ways to do it. One is to use hex:Code: [Select][010101010101]
[010000000001]
[010000000001]
[000000000000]➝pointer
Another way is to use the Data() command:Code: [Select]Data(1,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0)➝pointer
The only limit to these arrays of bytes is your free memory. If you had the memory free, you could have a 128*128 map or possibly larger.
Once you've set up your array of bytes, you would read each byte like you would a cell in a matrix.Code: [Select]{Y*Width+X+pointer}
Where Y is your Y-coordinate, X is your X-coordinate, and Width is the width of the map, and pointer is the pointer to your map data.
.0
[hexcode1]->pic0
.1
[hexcode2]
for a,0,11
for b,0,7
pt-on(a*8-8,b*8-8,{Y*Width+X+pointer}+pic0)
end
end
Thanks a lot Final Ti. :)
Thanks for correcting me. But if my map dat is stored in GDB1 then shouldn't I write: pt-on(a*8-8,b*8-8,{Y*Width+X+GDB1}+pic0)So If I didn't make a mistake here, this should draw (a part of the map) to fill the screen?Code: [Select].0
Thanks a lot Final Ti. :)
[hexcode1]->pic0
.1
[hexcode2]
for a,0,11
for b,0,7
pt-on(a*8-8,b*8-8,{Y*Width+X+pointer}+pic0)
end
end
Nope, better like this ;) (In black, your correct code. In red, your wrong code. In green, corrected code,)
.0
[hexcode1]->Pic0
.1
[hexcode2]
for a,0,11
for b,0,7
For(A,0,11
For(B,0,7 .not really an error but not written with the exact syntax
pt-on(a*8-8,b*8-8,{Y*Width+X+pointer}+pic0)
Pt-On(A*8,B*8,{Y*Width+X+Pic0} .you put +pointer but the pointer is Pic0 here
End
End
pt-on(a*8-8,b*8-8,{Y*Width+X+pointer}+pic0)Actually, that's not correct either. That would read the data from the tile data, not the map data, which is what pointer represented.
Pt-On(A*8,B*8,{Y*Width+X+Pic0} .you put +pointer but the pointer is Pic0 here
Pt-On(A*8,B*8,{Y*Width+X+pointer} * 8 + Pic0)
Because each tile is 8 bytes.[010101010101]->GDB1
So "01" is 8 bytes?
Because each tile is 8 bytes....is referring to the sprites: [hexcode]→Pic0
No, it is an hex code. [01]=b00000001But if "01" is one tile and my map reader has to read each tile seperate, how does he only read that one?
I also have a question. How do we handle 2 bytes data ??? ?
(Axe 0.5.3 user)
To have 65535 and 65535 at GDB1 and GDB1+1, do I do
Data(65535r,65535r)→GDB1
or Data(65535,65535)r→GDB1
or Data(255r,255r,255r,255r)→GDB1
etc...
and to read, I use {GDB1r} or {GDB1}r ?
No problem. I help those who need help because I first received help when I needed.Data(65535r,65535r)→GDB1
Yay, quoting myself :w00t:I also have a question. How do we handle 2 bytes data ??? ?
(Axe 0.5.3 user)
To have 65535 and 65535 at GDB1 and GDB1+1, do I do
Data(65535r,65535r)→GDB1
or Data(65535,65535)r→GDB1
or Data(255r,255r,255r,255r)→GDB1
etc...
and to read, I use {GDB1r} or {GDB1}r ?
could someone please provide me a code to check if another program is using the same code :PIt's impossible to guarantee this perfectly. Moreover, it doesn't seem very necessary :/ Anyway, you could assign a random number to each of your games and have each copy send its number to the other calc, where it's checked for equality. This would mainly prevent accidents more than anything else.
poorly said :P
Like to make sure, in a 2 player game, that the other person is running the program to.
How can i rotate a square section/ all of my screen 64 (90) degrees?I suggest going through each bit of one buffer and changing the bits of another. This would probably be done using the e command.
Repeat getKey(15)
.UPDATE POSITIONS
X+H→X
Y+V→Y
A+C→A
B+D→B
.SET MAXIMUM SPEED
If H>>256
256→H
End
.SET MAXIMUM SPEED
If (H<<-256)
-256→H
End
.RIGHT FRICTION
If A>>0
A-1→A
End
.LEFT FRICTION
If A<<0
A+1→A
End
End
flipH(flipV(Pic1)) should work.
flipH(flipV(Pic1)) should work.
Axe says that these functions can't be used recursively D: You would need to copy the data in between each flip
1 is a bit small. Set the friction to something bigger.Code: [Select]Repeat getKey(15)
.UPDATE POSITIONS
X+H→X
Y+V→Y
A+C→A
B+D→B
.SET MAXIMUM SPEED
If H>>256
256→H
End
.SET MAXIMUM SPEED
If (H<<-256)
-256→H
End
.RIGHT FRICTION
If A>>0
A-1→A
End
.LEFT FRICTION
If A<<0
A+1→A
End
End
This is not the full code of my program, it's just part of it, the part where I control the horizontal acceleration.
Horizontal Acceleration is saved on variable H, and I'm using Fixed Point (x256).
I try to give H friction, so that when the player presses thearrow, the player stops after a bit. However, it's not really working.
Any ideas on how I can make it? Thanks
H>>0-(H<<0)->S //get direction of velocity
If S //if we're moving
H-S->H //decrease velocity by 1 in the opposite direction
End
H<<0-(H>>0)->S
If
+H->H
End
Could someone give me an example of how to store data in a program itself? For example, if I wanted to store the highscore in the program.You'll want to read part of this (http://ourl.ca/4129/80259) thread, starting in that location. Good luck. :D
[FFFFFFFFFFFFFFFF]->Pic1
1->{Pic1}
A far simpler way to use write-back is to compile your program for MirageOS or DoorsCS. This will require that the program be run by a shell that allows easy write-back in the form of you simply modifying data in your running program, and the shell will then write any changes back to the original copy.Yes, but you can still turn writeback off. I think it's better to force it. ;)
I don't think you should force write-back. If a user has write-back disabled, they probably have it off for a good reason and would be annoyed if your program ignores that they purposely disabled write-back.True. I'm just thinking about the user that doesn't know what the writeback option does and then complains about his game not saving because I've been that person before.
A?Pt-On(X,Y,Pic1)
Is supposed to throw an error? It seems like every time I try to do a Pt-blarg() it errors x.x
Code: [Select]A?Pt-On(X,Y,Pic1)
Is supposed to throw an error? It seems like every time I try to do a Pt-blarg() it errors x.x
Ok, good to know.It's in the Matrix menu.
Another one. Is Buff()/Zeros()/det() in any of the menus? I haven't been able to find it outside the catalog..
Why can't we abuse the ? operators?What exactly would that do? O_o
I want to be able to do
Q?If blarg
Stuff
Q?End
It would ignore the If statement if Q!=0, executing StuffWhy can't we abuse the ? operators?What exactly would that do? O_o
I want to be able to do
Q?If blarg
Stuff
Q?End
Theoretically, it could be abused, but it wouldn't be any more optimized than a regular if statement, just more cluttered and less readable. I added the ? and ?? as operators specifically to avoid chains of if/while statements like If A:If B:If C:something:End:End:End should just be if A?B?C:something:End. I don't want to allow intentionally misleading code as legal syntax when there is already a better way to represent it.Huh.
If Q=0??Blarg
stuff
End
:10->x
:text(0,0,x)
Thanks in advance. :)
:10->x
:x->str1
Thanks, it helped. :DYou would have to write code to manually extract the digits, convert to tokens, and put into a TI-OS string variable.
EDIT:I have another question.
I want to save the value of x to a string, so I can see it out of my program. The following doesn't seem to work.Code: [Select]:10->x
:x->str1
L1+5→A
0→B
While 1
B+1→B
X^10+'0'→{A-1→A}
EndIf X/10→X
Copy(A,GetCalc("Str1",B),B)
strcmp) Doing
If Str1=Str2doesn't work (and it won't compile).
As it happens, Axe has a command just for that purpose!I believe you mean Equ▶String(STR1,STR2). expr (exch) just exchanges two chunks of data and would need a third argurment telling it how much to exchange. ;)
expr(Str1,Str2)
Whoops, silly me and my spatial thinking; the two are right next to eachother in the catalogue and I looked at the wrong one in my head when I answered. Silly me!As it happens, Axe has a command just for that purpose!I believe you mean Equ▶String(STR1,STR2). expr (exch) just exchanges two chunks of data and would need a third argurment telling it how much to exchange. ;)
expr(Str1,Str2)
3->{0+L1}
6->{1+L1}
20->{2+L1}
NUMBER -> {array_index * subarray_length + subarray_index + L1}
(the subarray_length starts with 1, not 0)
{row * row_length + column + POINTER}
or...
{Y * width + X + POINTER}
If each subarray has a different length, you could perhaps make an array containing pointers to each array, although it feels a bit inception-esque to me.
Wow, since I am a newbie to Axe i don't think i understand anything of this.Thanks, it helped. :DYou would have to write code to manually extract the digits, convert to tokens, and put into a TI-OS string variable.
EDIT:I have another question.
I want to save the value of x to a string, so I can see it out of my program. The following doesn't seem to work.Code: [Select]:10->x
:x->str1
Maybe something like this (input is in X, uses 5 bytes at L1 to temporarily store characters):Code: [Select]L1+5→A
0→B
While 1
B+1→B
X^10+'0'→{A-1→A}
EndIf X/10→X
Copy(A,GetCalc("Str1",B),B)
Wow, since I am a newbie to Axe i don't think i understand anything of this.
I will try to ofcourse
You need to remember, that the keys have different numbers, clear is 15.I'm aware of that, I've gotten it pretty much memorized after ~1 year of using Axe. :P the thing is, [Math] happens to be 47 instead of 15 ;)
On the topic of keypresses, isn't there a bug that makes some keys confused with each other? It has happened to me before.Yes there is. http://ourl.ca/7652/133708
A question : I've got the hex code of a picture, but how can I display it *where I want* on the screen?Put the width and height bytes before it and use the Bitmap() function.
I do believe that direct keypresses do not work correctly in fullspeed mode. switch to normal before checking for keypresses
Does Axe handle getKey(#) differently in Full speed mode? It keeps bugging on me whenever I try it..
This being said, some calc run faster than 15MHz. Mine, for instance runs at 16.495MHz (Revision M, tested with thepenguin's TrueSpeed program).Does Axe handle getKey(#) differently in Full speed mode? It keeps bugging on me whenever I try it..
I can only think of two things that could be causing this. Either Axe is having problems and parsing your code incorrectly, or your calculator is running substantially faster than 15MHz and the built-in delay isn't enough. I'm guessing that it's the second case, especially if you're using wabbitemu. If so, make sure that you didn't enable the option called "Emulate 20MHz and 25MHz calculators" or "Emulate proposed hardware speeds" because having this checked would certainly cause your problem.
I'm pretty sure that Quigibo purposely added extra delay so it would work at 15MHz.Huh, didn't know about that :P Wow, apparently that was fixed over a year ago :O Well, looks like that just shows how often I use 15mhz mode :P
I'm probably missing something, but how do the Port commands relate to getKey?Ports are an ASM construct, and are used to interface with all kinds of hardware (not just the external link ports). In this case, it is the keypad port.
!If getCalc("Str1")→A
.ERROR
End
.A holds pointer to string of tokens
!If GetCalc("Str1",SIZE)→A
.ERROR
End
.A holds pointer to a new string that is SIZE bytes large
:.A
:Data(40,44)→Pic1
:[00003A00000001E1900000079764000000719A00
:[002DFEB500002E688980002207B2800069DE6D80
:[00A803C2C00097DC9C40066233F7E006DF07F960
:[0F661C96A00D99E32D501E271CDEA02963F36760
:[34260C9D503B45F36AA03CB70C95602969FB6D60
:[46A90D2A502AD5F2EA40151776AAE014AAD52A40
:[0AA12B6BC0A955EAB90084543545405457CF5140
:[122852AB00255DB54E000AAE856D00154A440800
:[AAB1EBB500152CAA9800202612B600149A4DF000
:[0812B540000865382000082A0A80000212A80000
:[02A4040000010850000000128000000000000000
:Tangent(10,20,Pic1
:Repeat getKey
:End
What it displays :Reverse the order of the height and width bytes. ;)Oh my..
While getKey(0)
Pause 5
End
Haleyia, I had the same problem, so I added a pause :Thanks ! It works !!! :DCode: [Select]While getKey(0)
Pause 5
End
It's pretty hard not to fail when spelling your name :PNo. Just think it is like Hayley Wiliams but with IA at the end.
Code: [Select] "test"[00]→Str1 | Code: [Select] Text(0,0,"test") |
Text(x,y,"string")
you can use Text(Y*256+X):Text "String"
to save space (could be outdated, and maybe you have to invert x and y in Y*256+X)
In term of space in the compiled code. Are those methods the same ?No, they are not the same. Since Axe automatically appends a [00] to the end of everything with quotes around it that you store to a location (like "test"→Str1) the code on the left will actually be one byte larger.
Code: [Select]"test"[00]→Str1
Text(0,0,Str1) Code: [Select]Text(0,0,"test")
Code: [Select] "test"→Str1 | Code: [Select] Text(0,0,"test") |
Tip:Oh, yeah, and I forgot to mention that this tip is outdated as of Axe 0.2.3 or so. ;)
Instead ofCode: [Select]Text(x,y,"string")
you can useCode: [Select]Text(Y*256+X):Text "String"
to save space (could be outdated, and maybe you have to invert x and y in Y*256+X)
If the coordinates are constant you can save a lot of space. If the coordinates are separatley evaluated expressions then it doesn't matter.Ah, I didn't realize this. Thanks!
(I think)
Is there a way to store/export program out of appvar?Like how?
SMC?Hover over the text.
oh.It's code that modifies itself. Yours is kinda doing that.
how does self modifying code works?
Which would be faster/more optimized to check for?Exactly the same. They're two forms of conditional jumping in assembly.
If rand^2
or
!If rand^2
Or would they be the same?
I tried with 0.5.3bYeah, Axe is kinda tetchy about that. There's really no way around it, other than UnArchiving it.
It seems Equ>String( doesn't work with files ?
I loaded an appvar into Y0, used it with another pointer in Equ>String, and Axe says : "Error : File Misuse"
I tried with 0.5.3bYou could copy the string to a SafeRAM area, or a var in the RAM, then run the comparison from there.
It seems Equ>String( doesn't work with files ?
I loaded an appvar into Y0, used it with another pointer in Equ>String, and Axe says : "Error : File Misuse"
-/...././/--./.-/--/.translated: THE GAME :(
you could encrypt it using some random code (that of course is stored in the appvar)What do you mean with 'random code' ? (I'm French, didn't understand exactly, sorry :P)
also:Well done !Quote-/...././/--./.-/--/.translated: THE GAME :(
I used to knew the morse alphabet, forgot it :P
{Data('D','A','B','C')+A-'A'}
After storing some values in Pointer, is there a way to "DelVar" it?That is both a strength and weakness of shell programs. A strength because you don't have to create an appvar for save games, a weakness because you can't keep the original data for the next run if you modified it.
Every time I run the program, the Pointer still have all the values.
:.AA
:[Pic1]
:DispGraph
:getKey{r}
Well, it doesn't display pic1......
:.AA
:[Pic1]->A
:[Pic2]->B
:Copy(A,L6,768
:Copy(B,L6,768)r //Radian r
:Repeat getKey
:Dispgraphrr //Radian rs
:End
Well, It doesn't display the correct thing in 4-level grayscale, it jus diplays everything in Pic1 in dark gray.
What was L3 again? :DThe backbuffer
So there is no way to clear it?After storing some values in Pointer, is there a way to "DelVar" it?That is both a strength and weakness of shell programs. A strength because you don't have to create an appvar for save games, a weakness because you can't keep the original data for the next run if you modified it.
Every time I run the program, the Pointer still have all the values.
.ZA
Text(0,0,F(5,6)>Dec)
Text(50,0,F(6,5)>Dec)
Text(0,10,F((6-1),(6+1))>Dec)
Text(50,10,F(6,6)-1>Dec)
Text(0,20,F(6,(5+4))>Dec)
Text(50,20,F(6,5)+F(6,4)>Dec)
Pause 5000
Lbl F
r1*r2+r1+r2
Return
Text(50,20,F(6,5)+F(6,4)>Dec)
^
:.MPREV
:GetCalc("varF")->A
:GetCalc("varP")->B
:float{A}->F
:float{B}->P
:F->oAA //o is a degree sign
:P->oBB
:freq(oAA,oBB
:Return
It compiles, but it won't produce sound.:.MPREV
:GetCalc("varF")->A
:GetCalc("varP")->B
:float{A}->F
:float{B}->P
:freq(F,P
:Return
So will future versions of Axe be completely object-oriented? O.OOnly if you want it be, I guess.
GetCalc("varA"->B
float{B}->A
Now, is there a way to store that A into constant?
I have a question:Close your parentheses properly. The pointer to the string "varA" is being stored into B rather than the result of GetCalc().
so, you import OS var by doing this, right?Code: [Select]GetCalc("varA"->B
Now, is there a way to store that A into constant?
float{B}->A
I have a question:
so, you import OS var by doing this, right?Code: [Select]GetCalc("varA"->B
Now, is there a way to store that A into constant?
float{B}->A
GetCalc("varF")→X
GetCalc("varP")→Y
float{X}→F
float{Y}→P
freq(F,P)
Return
but it still won't produce the sound D: (I put 314 = F and 16384 = P)0->block_count
While game_is_running == True:
If create_a_block == True:
rand^94->{block_count * 2 + L1} // X-coordinate
0->{block_count*2 + 1 + L1} // Y-coordinate
block_count++
End
For(A, 0, block_count): // or is it 'For(A, 0, block_count - 1)' ?
{block_count*2 + 1 + L1}++ // Increment each Y-coordinate so that every block moves down
End
[game code here]
End
Well, assuming that you assign each block an X and Y coordinate in a buffer, you could simply do a 'rand^94' when assigning an x coordinate, then leave it alone.
.Creating x
rand^94->I
rand^94->J
rand^94->K
rand^94->L
rand^94->M
.Some other stuff
.Drawing
If D<140
D+1->D
Pt-On(I,D,Pic2)
Pt-On(J,D-20,Pic2)
Pt-On(K,D-40,Pic2)
Pt-On(L,D-60,Pic2)
Pt-On(M,D-80,Pic2)
end
.More other stuff
.Checking if blocks collide with Pic1 which is located at x,y
If abs(I-X)<8
If abs(D-Y)<8
Return
End
End
If abs(J-X)<8
If abs(D-20-Y)<8
Return
End
End
If abs(K-X)<8
If abs(D-40-Y)<8
Return
End
End
If abs(L-X)<8
If abs(D-60-Y)<8
Return
End
End
If abs(M-X)<8
If abs(D-80-Y)<8
Return
End
End
.Number of blocks (don't exceed about 350)
100->N
.Clearing L1 (there are more efficient ways to do this,
.but I can never remember the exact syntax).
For(I,0,N*2)
0->{L1+I}
End
While 1
.Creating X and Y
For(I,0,N)
If {I*2+L1+1} > 64
rand^94->{I*2+L1}
0->{I*2+L1+1}
End
End
.Some other stuff
.Drawing
For(I,0,N)
I*2+L1->J
Pt-On({J},{J+1},Pic2)
{J+1}+1->{J+1}
End
.More stuff
.Collision check
For(I,0,N)
I*2+L1->J
If abs({J}-X)<8
ReturnIf abs({J+1}-Y)<8
End
End
.Obligatory emergency exit
ReturnIf getKey(15)
End
.Number of blocks (don't exceed about 350)
100->N
.Clearing L1 (there are more efficient ways to do this,
.but I can never remember the exact syntax).
For(I,0,N*2)
0->{L1+I}
End
While 1
.Some stuff
For(I,0,N)
.Creating X and Y
If {I*2+L1+1} > 64
rand^94->{I*2+L1}
0->{I*2+L1+1}
End
.Drawing
I*2+L1->J
Pt-On({J},{J+1},Pic2)
{J+1}+1->{J+1}
.Collision Check
I*2+L1->J
If abs({J}-X)<8
ReturnIf abs({J+1}-Y)<8
End
End
.More stuff
.Obligatory emergency exit
ReturnIf getKey(15)
End
If you storedNo.
{A*10+1+L1}
into J, would {J+1} be the same as {A*10+2+L1}?
Also, inTop left corner of that sprite block.
PtOn(x,y,Pic1)
If pic1 is an 8x8 sprite, what part of the sprite is located exactly at x,y?
What he means by that is you'd store A*10+1+L1 into J, not {A*10+1+L1}.QuoteIf you storedNo.
{A*10+1+L1}
into J, would {J+1} be the same as {A*10+2+L1}?
If G=1
[hexadecimal]->Pic1
ElseIf G=2
[different hexadecimal]->Pic1
ElseIf G=3
[different hexadecimal]->Pic1
ElseIf G=4
[different hexadecimal]->Pic1
ElseIf G=5
[different hexadecimal]->Pic1
Else
[different hexadecimal]->Pic1
end
[SPRITE DATA 1]->Pic1
[SPRITE DATA 2]
[SPRITE DATA 3]
...
Pt-On(X,Y,G*8+Pic1
Is there an option to turn the calc off while in a axe program?I assume you want something like this: http://ourl.ca/10110/250926 (Read all of the stuff in quotes.)
for example, If I were to make a password program...
On second thought, you could use some of the routines here (http://ourl.ca/4129), if you give the author credit. Click the link, and then search "input" to find the good stuff :)Yup, that's a great link. If you don't want to search, though, you can always use the index: http://ourl.ca/7818
:.ROBOGUN
:DiagnosticOff
:[FCFC000000000000]→Pic2
:[081C2A4908080808]→Pic0
:[F080800000000000]→Pic1
:[FCA0A02000000000]
:[FFFCA0A080000000]
:[FCFFFC4848484000]
:[F8FFFFF848484850]
:[F8FFFFFFFC6C6C6C]
:[Pic9]→Pic8
:Fix 5
:Repeat getKey(15)
:copy(Pic8,L6,768)
:Text(35,1,"RoboGun")
:Text(1,55,"New Game"
:Text(60,55,"Load Game"
:Pt-On(75,47,RotC(Pic0)
:Pt-On(12,48,RotCCPic0)
:If getKey(2)
:Goto N
:End
:If getKey(3)
:Goto L
:End
:DispGraph
:End
:Lbl L
:ClrDraw
:Goto 1
:Lbl N
:0→G
:1→L
:Lbl 1
:43→X
:0→M
:27→Y
:Repeat getKey(15)
:ClrDraw
:If getKey(2)
:X--
:End
:If getKey(3)
:X++
:End
:If getKey(1)
:Y++
:End
:If getKey(4)
:Y--
:End
:If getKey(48)
:0→R
:End
:If getKey(40)
:1→R
:End
:If getKey(54)
:1→F
:End
:If R
:Pt-On(X,Y,Pic1+L*8)
:Else
:Pt-On(X,Y,FlipH(Pic1+L*8)
:End
:If F
:X+4→S
:Y+1→T
:Pt-On(S,T,Pic2
:0→F
:1→M
:End
:If M
:If R
:S++
:End
:!If R
:S--
:End
:Pt-On(S,T,Pic2)
:If S=94 or S=0
:0→M
:1→F
:End
:End
:End
:Fix 4
input()What ? I didn't understand your post, especially the "input()" part with nothing before and nothing after ??? but I am sure that it doesn't answer my question :P
btw, i wrote an axe function called BCALL(), where the only argument is the address to bcall. I made it run _powerOff successfully as well.
Max Symbols means you have over the limit of how many Pic0/GDB0/Str0 types of constants you are allowed to have. The current version of Axe has a symbol limit of over 2000, are you updated to a version as recent as 1.0.0 or higher?Nope. I am still using 0.5.3 because updating would make me change too much things in my code D:
...Pic0/GDB0/Str0 types of constants...Are labels also included ? because the error happened after I added a sub(APD) (that is not a true APD)
What kind of things would you have to change?All the GDB1→DispGraph would have to become DispGraph(GDB1). And even if my code is not optimized and do not use a lot of those, it is huge (the code) and I am lazy :P
And yes Labels are included as well.But once a label is added, I can put as sub(<lbl>) as I want ?
Oh now that I think about it, Axe might have included the old syntax as well for 100% backwards compatibility :DOk, good to know, thanks :D (even if I am sure I will soon forget).
It also added peephole optimization, which is what makes compiling slower. To disable this, just press Zoom instead of enter to compile a program.
Yeah, 1.0.5 is pretty good stuff. Now for my question: I am using a list of numbers to hold what a set of aligned sprites is. How can I convert the position of the number in ram, to the coordinates of where the sprite should go?
That doesn't quite work, as that is storing the pointer into Pic1, not storing the pointer as Pic1. This will also modify your program if you use a shell like MirageOS. Probably the best design would be something like this:Code: [Select][SPRITE DATA 1]->Pic1
[SPRITE DATA 2]
[SPRITE DATA 3]
...
Pt-On(X,Y,G*8+Pic1
Where G=0 is the first sprite, G=1 is the second sprite, and so on
Axe does its math from left to right and IGNORES pemdas!But Axe is good friends with lambdas ;D
!If GetCalc("appvTLKC",Y0
GetCalc("appvTLKC",6)->K // Code 1
sub(MOD //
Else
Repeat M=6 //
0->M // Code 2
sub(SA //
sub(CM //
End
End
I attached it below :)
If you don't care too much about accuracy, you can do √(A)∗16.that would be great. Axe has lots of unuesd tokens, and I believe you can even make your own token hook if you so desire.
Alternatively, I wrote an 8.8 square root routine in asm... If you can give me a token to use (not √( since Axe has dibs) I could make an Axiom.
Ah this looks like a bug with Axe's peephole optimizer! Dang it, here I was telling you to upgrade and it's not even a stable build x.x In the meantime, instead of selecting your program by pressing enter, press the Zoom button instead, and everything should work like it normally does.
:.Load game label
:Lbl L
:"appvMONEY"→Str0
:"appvLEVEL"→Str9
:Unarchive Str0
:Unarchive Str9
:!If GetCalc(Str9)→W or GetCalc(Str0)→E
:Goto N
:End
:{W}→G
:{E}→L
:Goto 1
:Lbl N
:. Im not sure what to put as the size
:GetCalc(Str0,64)→W
:GetCalc(Str9,32)→E
:0→{W}→{E}→G→L
:Lbl 1
:. At the end of the code...
:. The save subroutine
:Lbl SAVE
:Unarchive Str0
:Unarchive Str9
:G→{W)
:L→{E}
:Archive Str0
:Archive Str9
:Repeat getKey(9)
:ClrDraw
:Text(1,1,"Saved!")
:DispGraph
:End
:Return
:!If GetCalc(Str9)→W or GetCalc(Str0)→E
:!If ((GetCalc(Str9)→W) or GetCalc(Str0))→E
:0→{W}→{E}→G→L
How would I do that then?
:!If (GetCalc(Str9)→W) or (GetCalc(Str0)→E)
or something?
Also, what is a good size to use for the appvars?
{W} will be up to several thousand
{E} will be up to 6
Then your appvar would only need to be 2 bytes long. Also, if you only need to store 2 numbers, why not just have 1 appvar that is 4 bytes long instead of two 4 byte appvars?
Then your appvar would only need to be 2 bytes long. Also, if you only need to store 2 numbers, why not just have 1 appvar that is 4 bytes long instead of two 4 byte appvars?
So I have two objects, and I'm trying to make one object shoot a projectile at another. How would one go about that?
(I've been trying to do this all night to no avail :P)
Idk{POINTER} reads a single byte (0 to 255), while {POINTER}r reads two (0 to 65,535). That might be why.
Straight. Trying to not make it too complicated :PSo I have two objects, and I'm trying to make one object shoot a projectile at another. How would one go about that?A straight path, or a parabolic one?
(I've been trying to do this all night to no avail :P)
sqrt(abs(X-C)/256^2+(abs(Y-D)/256^2))->L
C-X//L->A
D-Y//L->B
[all FFs]→Pic1
[C0C000...]→Pic2
0→X→Y→Z
12032→S
7936→S
.center of screen, x256
-1000→Θ
.lazy way of making it create bullet in first frame :P
Repeat getKey(15)
X+(getKey(3)*256)-(getKey(2)*256)→X
X+(getKey(1)*256)-(getKey(4)*256)→Y
Pt-On(X//256,Y//256,Pic1)
If ...(bullet goes off-screen)
sqrt(abs(X-S)/256^2+(abs(Y-T)/256^2))->A
S-X//A*50->A
T-Y//A*50->B
.without the *50 it was moving really slow so yeah
S→Z
T→Θ
End
U+Z→Z
V+Θ→Θ
Pt-On(Z//256,Θ//256,Pic2)
DispGraphClrDraw
End
Sqrt(abs(X-C)/256^2+(abs(Y-D)/256^2))->L
Sqrt(abs(0-2560)/256^2+(abs(0-0)/256^2))->L
Sqrt(10^2 + 0^2)->L
10->L
X-C//L->A
0-2560//L->A
-2560//10->A
-256->A
Darl181 and 19 Guests are viewing this topic.0.o
.ATT1
[FFFFFFFFFFFFFFFF]→Pic1
[C0C0000000000000]→Pic2
[6090906000000000]→Pic3
0→X→Y→Z
12032→S
7936→T
~1000→theta
Repeat getKey(15)
X+(getKey(3)*256)-(getKey(2)*256)→X
Y+(getKey(1)*256)-(getKey(4)*256)→Y
Pt-On(X//256,Y//256,Pic1)
...
rand^3-1*256+S->S
(S<<6144)*256-((S>>18432)*256)+S->S
rand^3-1*256+T->T
(T<<4096)*256-((T>>12288)*256)+T->T
Pt-On(S//256-1,T//256-1,Pic3)
...
Pt-On(46,30,Pic3)
If Z>>24320 or (Z<<0) or (theta>>16128) or (theta<<0)
√(abs(X-S)/256^2+(abs(Y-T)/256^2))→B
S-X//B→U
T-Y//B→V
X→Z
Y→theta
End
U+Z→Z
V+theta→theta
Pt-On(Z//256,theta//256,Pic2)
DispGraphClrDraw
End
Generated by the BBify'r (http://clrhome.tk/resources/bbify/ (http://clrhome.tk/resources/bbify/))
It's because you are using the modular expression ^ instead of the squared symbol :)/me looks at above code and attached source...
Also since there isn't a sqrt() token, is that 2nd + x2?
:λ(EXPR)→A
:ʟTEMP→A
:
:Lbl TEMP
:Return EXPR
:Lbl Merge
:r₁→r₆
:L₆→A
:For(768)
: (r₆)({A},{A+L₃-L₆})→{A}+1→A
:End
:Return
:Merge(λ(r₁ or r₂)) ."or" the buffers together.
:Merge(λ(r₁ xor r₂)) ."xor" the buffers together.
:Merge(λ(r₁ and r₂)) ."and" the buffers together.
:Merge(λ(not(r₁) and r₂)) .some other logic
:Merge(λ(0)) .Clear the buffer
:Merge(λ(255)) .Fill the buffer with black
:Merge(λ(r₂)) .Replace front buffer with back buffer
:Merge(λ(not(r₂))) .Replace front buffer with the inverse of the back buffer
I know how to use them :P lol. I just wasn't sure if their dimensions could be modified. (Like 5->dim(L1) in BASIC)If you modify them yourself (recode your array)
I know, that's been answered. I'm very much against hard-coding, though, so I don't want to keep doing that. I don't really plan any major projects in Axe anyway (I'm not really into calculator programming anymore), I just had some misc. programs I was playing around with.I know how to use them :P lol. I just wasn't sure if their dimensions could be modified. (Like 5->dim(L1) in BASIC)If you modify them yourself (recode your array)
Do you have a tile that isn't anything (or is, say, floor)?So it isn't impossible to overwrite a number at a GDB at a certain point, like this:
Say it's zero, and the map is 12*8 (typical 8*8-tile map) and stored row-by-row...Ofc variables can be changed so they don't overwrite X and Y :PSpoiler For code:
:[01010101010101]->GDB1
:2->{2+GDB1}
That would make that GDB1=01010201010101
Or am I mistaken?
That is possible, but that is called 'self-modifying code' or 'writeback'. The thing is, that you cannot use it in an app. The best way is copying the map to L1 or another place in RAM.So I copy the code to GDB 2, for example and edit that one?
Nope, you should copy it to some place in RAM that you can edit freely, then delete it afterward (My tip: use an appvar)Okay, thanks guys. I'll look at that. :)
For(P,0,C)
If abs({P*2+L1+1}-Y)<7
If abs({P*2+L1}-X)<7
E--
End
End
End
Text(40,1,"HEALTH:")
Rect(66,2,(66+(E/2)),5)
If E<1
2->N
Return
End
Doesn't crabcake require you to exit in a very specific manner?Yes, you must go to the end of the program where you put AxesOff.
What is the maximum program size? I'm at 7000 bytes now.I think it is 8000 of code, not including data. But I am probably wrong :P
Wait, I saw somewhere that we could quit the program with Returnr but it crashes when I try ???. I thought it might be because of CrabCake, but I don't know. Could it be ?
Returnr|Emergency exits the program from within any number of nested calls.;)
What is the maximum program size? I'm at 7000 bytes now.It's 8150-something if you're compiling for 'No Shell', 8811 otherwise.
I believe it is 8192, but yeah, 8811 for shelled programs.Wait, I saw somewhere that we could quit the program with Returnr but it crashes when I try ???. I thought it might be because of CrabCake, but I don't know. Could it be ?Quote from: Axe DocsReturnr|Emergency exits the program from within any number of nested calls.;)What is the maximum program size? I'm at 7000 bytes now.It's 8150-something if you're compiling for 'No Shell', 8811 otherwise.
Erm, I have problems translating "from within any number of nested calls" D:Wait, I saw somewhere that we could quit the program with Returnr but it crashes when I try ???. I thought it might be because of CrabCake, but I don't know. Could it be ?Quote from: Axe DocsReturnr|Emergency exits the program from within any number of nested calls.;)
Unless you use Fullrene/Crabcake, which gets rid of the limit, right?I believe it is 8192, but yeah, 8811 for shelled programs.Wait, I saw somewhere that we could quit the program with Returnr but it crashes when I try ???. I thought it might be because of CrabCake, but I don't know. Could it be ?Quote from: Axe DocsReturnr|Emergency exits the program from within any number of nested calls.;)What is the maximum program size? I'm at 7000 bytes now.It's 8150-something if you're compiling for 'No Shell', 8811 otherwise.
Unless you use Fullrene/Crabcake, which gets rid of the limit, right?what are those?
They are axioms that gets rid of the 8811/8192 KB code limit, if I remember.ooh that's cool.../me checks the ticalc files for it... :D
.A is for level
If A=1
.The first argument is the money requirement
GAME(0,6,0,4,3,1
ElseIf A=2
GAME(300,0,0,4,3,1
ElseIf A=3
(goes on with different args 'till A=8)
End
.Lotsa stuff
Lbl GAME
.Lotsa stuff
For(P,0,r5)
.Lotsa stuff
If (r2<J) and (r1<G) and (r3<L)
.G is the amount of money the user has
A++
G-r1->G
1->N
.Level up and return
Return
End
DispGraph
End
[Pic#]->A .this puts your TI-OS-PIC# in the ram and stores the beginning address to a.
Copy(A,L6,768) .this copies the 768 bytes to the main buffer to display the picture.
You need to get the picture as TI-OS-Picture-Variable (Pic0 - Pic9).Thank you. :)
In your Axe program file you simply write:Code: [Select][Pic#]->A .this puts your TI-OS-PIC# in the ram and stores the beginning address to a.
Copy(A,L6,768) .this copies the 768 bytes to the main buffer to display the picture.
If I get too high I'll try Fullrene.Help?
Can any figure out what's wrong with this?
My game has levels and it always skips level 2. Once you start it, it automatically says you win. The unique thing about level two is that it has money requirements to win it, not enemy kill requirements.Code: [Select].A is for level
If A=1
.The first argument is the money requirement
GAME(0,6,0,4,3,1
ElseIf A=2
GAME(300,0,0,4,3,1
ElseIf A=3
(goes on with different args 'till A=8)
End
.Lotsa stuff
Lbl GAME
.Lotsa stuff
For(P,0,r5)
.Lotsa stuff
If (r2<J) and (r1<G) and (r3<L)
.G is the amount of money the user has
A++
G-r1->G
1->N
.Level up and return
Return
End
DispGraph
End
I've one more question:You need to get the picture as TI-OS-Picture-Variable (Pic0 - Pic9).Thank you. :)
In your Axe program file you simply write:Code: [Select][Pic#]->A .this puts your TI-OS-PIC# in the ram and stores the beginning address to a.
Copy(A,L6,768) .this copies the 768 bytes to the main buffer to display the picture.
For gray, you need 2 pictures then copy the 2nd buffer to L3.like:
You can also create pics on your calc...
That is right yepCan I have 4 level grayscale(black,white,light and dark gray) or 3(black, white, gray)?
For creating a gray pic, create some program that lets you edit both buffers at one time. (and ofcourse save the 2 pics)
PART_1:
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFC3C3DBC3C3C3C3C3DFDFFF
FFC3C3DBC3C3C3C3C3DFDFFF
FFDFDBDBDBDBDFDBDBDFDFFF
FFC3DBDBC3C7C3C7C3DFDFFF
FFC3DBDBC3C7C3C7C3DFDFFF
FFFBDBDBDBDBDFDBDBDFDFFF
FFC3C1C3DBDBC3C3DBC3C3FF
FFC3C1C3DBDBC3C3DBC3C3FF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
F007FFFFFFFFFFFFFFFFE00F
F0007FFFFFFFFFFFFFFE000F
F0001FFFFFFFFFFFFFF8000F
F0001FFFFFFFFFFFFFF8000F
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFF01151771111E089880FFF
FFF01755777577EAAAB80FFF
FFF01711771551EAAA880FFF
FFF0F755777557EAAABF0FFF
FFFFF155111511EA888FFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
F00FFFFFFC4C547FFFFFF00F
F00FFFFFFD5556FFFFFFF00F
F00FFFFFFC4D56FFFFFFF00F
F00FFFFFFD5556FFFFFFF00F
FFFFFFFFFD4C46FFFFFFFFFF
FFC01FFFFFFFFFFFFFF807FF
FF001FFFFFFFFFFFFFF801FF
F8001FFFFFFFFFFFFFF8003F
F0007FFFFFFFFFFFFFFE000F
F000FFFFFFFFFFFFFFFF000F
F003FFFFFFFFFFFFFFFFC00F
F007FFFFFFFFFFFFFFFFE00F
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
PART_2:
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFC3C3DBC3C3C3C3C3DFDFFF
FFC3C3DBC3C3C3C3C3DFDFFF
FFDFDBDBDBDBDFDBDBDFDFFF
FFC3DBDBC3C7C3C7C3DFDFFF
FFC3DBDBC3C7C3C7C3DFDFFF
FFFBDBDBDBDBDFDBDBDFDFFF
FFC3C1C3DBDBC3C3DBC3C3FF
FFC3C1C3DBDBC3C3DBC3C3FF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
F00FFFF11115E0898FFFF00F
F00FFFF7B555EAAABFFFF00F
F00FFFF1B531EAAA8FFFF00F
F00FFFFDB55DEAAABFFFF00F
FFFFFFF1B15DEA888FFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
F0001151771111E08988000F
F0001755777577EAAAB8000F
F0001711771551EAAA88000F
F000F755777557EAAABF000F
FFFFF155111511EA888FFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFF01FFFFFFFFFFFFFF80FFF
FE001FFFFFFFFFFFFFF8007F
FFF01FFFFFFFFFFFFFF80FFF
FFF03FFFFFFFFFFFFFFC0FFF
FFF0FFFFFFFFFFFFFFFF0FFF
FFF7FFFFFFFFFFFFFFFFEFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
F00FFFFFFFFFFFFFFFFFF00F
F00FFFFFFFFFFFFFFFFFF00F
F00FFFFFFFFFFFFFFFFFF00F
F00FFFFFFFFFFFFFFFFFF00F
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF
It says its for Axe, but how do I use this?
You have to manually put brackets around each line. For some odd reason sc doesn't do them, I'm guessing because it merges Axe and BASIC tho they're completely different.Okay, I see, but what should I upload again trough sourcecoder? A txt file with that in?
Anyway "PART_1" is the front buffer, "PART_2" is the back.
Once you put the brackets around each line (which is easier to do on a computer btw :P) you could run it through sc again to get the 8xp to send to the calc. On the first line store a pointer, then use a Copy() or similar to copy to L6 and/or just DispGraph from there.
:If <S1>
: <B1>
:ElseIf <S2>
: <B2>
:ElseIf <S3>
: <B3>
:...
:MySub()
:Lbl MySub
:If <S1>
: <B1>
: Return
:End
:If <S2>
: <B2>
: Return
:End
:If <S3>
: <B3>
: Return
:End
:...
If A=1
Text(1,16,"YOU HAVE BEEN GIVEN A GUN."
Text(1,24,"GO AND TEST IT OUT."
Text(1,32,"DESTROY 2 ENEMIES")
ElseIf A=2
Text(1,16,"BATTLE MORE."
Text(1,24,"DEFEAT 6 ENEMIES"
ElseIf A=3
Text(1,16,"THERE ARE 3 ENEMIES"
Text(1,24,"THEY ARE FAST"
ElseIf A=4
Text(1,16,"THE NEW GUN IS READY"
Text(1,24,"BUY THE WEAPON FROM THE"
Text(1,32,"UPGRADE MENU"
ElseIf A=5
Text(1,16,"THERE ARE 10 GUARDS"
Text(1,24,"DEFEAT THEM TO CONTINUE"
ElseIf A=6
Text(1,16,"THIS PLACE HAS ENEMIES THAT"
Text(1,24,"WILL BE AS FAST AS YOU."
Text(1,32,"KILL 4"
ElseIf A=7
Text(1,16,"NOW, BUY THE NEXT WEAPON"
Text(1,24,"FROM THE UPGRADE MENU"
ElseIf A=8
Text(1,16,"GOOD. YOU NOW MUST KILL"
Text(1,24,"10 ENEMIES"
ElseIf A=9
Text(1,16,"UPGRADE MORE."
Text(1,24,"GET THE NEXT GUN"
ElseIf A=10
Text(1,16,"DEFEAT 10 FASTER ENEMIES"
Text(1,24,"USING YOUR NEW WEAPON."
ElseIf A=11
Text(1,16,"DEFEAT 5 MORE ENEMIES"
Text(1,24,"TO CONTINUE"
ElseIf A=12
Text(1,16,"GET THE NEXT GUN"
Text(1,24,"FROM THE UPGRADE MENU"
ElseIf A=13
Text(1,16,"DEFEAT 10 FAST ENEMIES"
Text(1,24,"THEY WILL BE AS FAST AS YOU"
ElseIf A=14
Text(1,16,"DEFEAT 5 MORE ENEMIES"
Text(1,24,"THEY'RE REALLY FAST"
End
If A=15
Text(1,16,"GET THE LAST"
Text(1,24,"FROM THE UPGRADE MENU!"
ElseIf A=16
Text(1,16,"NOW ITS NIGHT TIME."
Text(1,24,"KILL 20 ENEMIES!"
ElseIf A=17
Text(1,16,"MIDNIGHT:"
Text(1,24,"KILL EVERYTHING. ALL 35"
Text(1,32,"THEY ARE SUPER FAST"
End
Text(1,56,"Push On"
Repeat getKey(41)
If getKey(15)
Goto C
End
End
Fix 5
If A=1
GAME(0,2,0,4,3,1
ElseIf A=2
GAME(0,6,0,4,3,1
ElseIf A=3
GAME(0,3,0,4,1,1
ElseIf A=4
GAME(0,0,1,4,3,1
ElseIf A=5
GAME(0,10,1,3,3,1
ElseIf A=6
GAME(0,4,1,1,3,1
ElseIf A=7
GAME(0,0,2,3,3,1
ElseIf A=8
GAME(0,10,2,3,3,1
ElseIf A=9
GAME(0,0,3,3,3,1
ElseIf A=10
GAME(10,0,3,1,3,1
ElseIf A=11
GAME(5,0,3,2,3,1
ElseIf A=12
GAME(0,0,4,2,3,1
ElseIf A=13
GAME(10,0,4,1,3,1
ElseIf A=14
GAME(7,0,4,1,3,2
End
If A=15
GAME(0,0,5,1,3,1
ElseIf A=16
GAME(20,0,5,1,3,2
ElseIf A=17
GAME(35,0,5,1,3,3
Am I doing this right?
"appvBLARG"→Str1
GetCalc(Str1,123)→oVAR
255→oVAR
!If oVAR-255
.if equal to 255
Disp "Yay"
Else
Disp "Noes"
End
So, say a certain person tried to make a program on their calculator in Axe, but when they made the main loop, they failed at the GetKey= statement and can't quit their program.If a program cannot be exited by normal means, the best way to cancel it is to pull a battery. RAM will be cleared, but nothing else will be damaged.
What should I, I mean they, do?
Also is Text(x,y):Text "Strings" smaller than Text(x,y,"Strings")?Nope, but Text(Y*256+X):Text "Strings" is, if Y and X are constants.
So, say a certain person tried to make a program on their calculator in Axe, but when they made the main loop, they failed at the GetKey= statement and can't quit their program.Make sure your getKey values are Axe keycodes, not BASIC keycodes: http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=21
So, say a certain person tried to make a program on their calculator in Axe, but when they made the main loop, they failed at the GetKey= statement and can't quit their program.Make sure your getKey values are Axe keycodes, not BASIC keycodes: http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=21
Why is this not stickied anymore?
so the oPTR is the physical location of it, just plain PTR references the contents?That is correct.
[181842424242423C]->GDB0
[01]
Str00
Str10
:5->A
:text(25,25,0 and A>Dec)
I want "05" printed. What must I do, if this is possible? I'm trying to find how to put two 'things' together. Like:You could try this:Code: [Select]:5->A
I want "05" printed. What must I do, if this is possible?
:text(25,25,0 and A>Dec)
Thanks in advance.
Text(25,25,'0','0'+A)
It only works for single digit numbers, though.
Really? I got it to work with multidigit numbersThanks that works. I just would wanna know if i could save "05" to something. Like this:
Using:
Text(25,25,"0",A->Dec
Also a somewhat relating question, how would you put together 2 strings and store it into a new string?
:[0000000000000000....]->GDB1
:For(A,0,8)
:rand^10->{GDB1+A}
:End
Wouldnt make sense to have any :P..unless it's a line of code with variable inputs, set up in a way that might have it happen. ;)
Exactly. I may use something like that myself. So will that copy itself to itself?Wouldnt make sense to have any :P..unless it's part of a line of code with variable inputs, set up in a way that might have it happen.
It's not always the same though. If you Copy(L1,L1+1,100), it will first copy L1 into L1+1, and then L1+1 into L1+2, effectively filling L1 to L1+100 with the first element, instead of shifting.To fix:
You mean Copy(L1+99,L1+100,100) :)It's not always the same though. If you Copy(L1,L1+1,100), it will first copy L1 into L1+1, and then L1+1 into L1+2, effectively filling L1 to L1+100 with the first element, instead of shifting.To fix:
Copy(L1+98,L1+99,100){r}
(I think)
does essentially the same as this:Copy(L1,L1+1,10)
But if you take it step by step, it's really doing this:For(A,0,9)
{A+L1}→{A+L1+1}
End
See the problem? You're copying the first byte to the second, then the second byte to the third, and so on, so in the end you're just copying the first byte to every byte after it for ten bytes. It would be doing the same as this:{L1}→{L1+1}
{L1+1}→{L1+2}
{L1+2}→{L1+3}
{L1+3}→{L1+4}
{L1+4}→{L1+5}
{L1+5}→{L1+6}
{L1+6}→{L1+7}
{L1+7}→{L1+8}
{L1+8}→{L1+9}
{L1+9}→{L1+10}
which isn't what we're trying to do.Fill(L1,10)
Lbl AXE
//
code
//
If something
sub(AXE
End
Return
Repeat
//
code
//
If something
Goto A
End
End
Is the Goto waiting for an 'End' token as it does with Ti-Basic ?Can we use recursion ?Yes you can. Just don't nest too many levels. Additionally, to preserve the old values of r1 to r6, which might otherwise get changed, you can use such as sub(LBL,1,2,3)r (That is, append a r)
Is the Goto waiting for an 'End' token as it does with Ti-Basic ?You don't need an End after a Goto in TI-BASIC.
Code: [Select]Repeat
Is the Goto waiting for an 'End' token as it does with Ti-Basic ? when used in an if statement, or a loop..
//
code
//
If something
Goto A
End
End
Edit : is there a problem with the line numbering ? If I add an empty line, it's fine though (see above ;))
QuoteIs the Goto waiting for an 'End' token as it does with Ti-Basic ?You don't need an End after a Goto in TI-BASIC.
He meant that the calculator hit a "If" before the "Goto" and so, after going to label A, the calculator is waiting for the "End" of the initial "If". Did I understand right ?Yes, that's what it does in Ti-Basic, and I was wondering if it was the same in Axe.
is there something out there that makes it easier to scroll through source code? eg: goto the last line (or middle line) of code, rather than scrollinghttp://ourl.ca/113185 scroll down to deep thoughts post
Yay!!!! :Dis there something out there that makes it easier to scroll through source code? eg: goto the last line (or middle line) of code, rather than scrollinghttp://ourl.ca/113185 scroll down to deep thoughts post
Hayleia: pretty much every random hex code gives a ram clear.Pretty much every random hex code will not cause a RAM clear. The only reason it works in TI-BASIC with AsmPrgm is because those programs never quit.
is there something out there that makes it easier to scroll through source code? eg: goto the last line (or middle line) of code, rather than scrollingAlso, if you use a 83+SE or 84+ or 84+SE or 84 pocket.fr (but not a 83+), you can install zStart and (among other amazing things) you will be able to jump to any label in your code by pressing On+Vars in the editor.
:C>0+C->C
or:If C>0
:C++
:End
Basically it comes down to an If statement, versus an expression evaluated each time.
Which of these is faster?Code: [Select]:C>0+C->C
orCode: [Select]:If C>0
Basically it comes down to an If statement, versus an expression evaluated each time.
:C++
:End
Is there a faster way to xor two buffers together than with a For() loop?No I don't believe so
Is there a way to draw a sprite directly to the screen?Not in Axe at any rate. One could write an axiom for it maybe, why do you want to draw a sprite to the screen only?
So I don't have to worry about platforms and such being erased. On the same idea, how do I draw mono "transparent" sprites?I believe the command you're looking for is Pt-Mask()r
So you'll want to create a greyscale sprite like this:Thanks. So I must just use it like this? :
Black is where you want black
light grey is where you want white
dark grey is where you want grey
white is where you want transparency
and just Pt-Mask (under plot for some reason) with the usual arguments.
One-page app capacity (minus the header and signature) is 16160 bytes. I guess you could either do some hardcore optimization or put some data in an external appvar.ok then, I'll do that. :)
I'm pretty sure it's like that, just have the second line of hex under/part of the first one.
...
Ok, I was optimizing last night and wrote down a bunch of Q's as I went.
Do the ?/?? conditionals save space in the executable in relation to conventional If loops? How about speed?Can they be nested? like B?(A++5?-1→A),→Aworks, nvm that
Which is faster: If (commonly true) / If (sparsely true) ?
So it's optimized to put the constants at the end...what if it's like L2+2? Would a different order influence anything?
How do I put parts of a code as an appvar?lol I was just about to ask that, I need it for some optimizations :D
How do I put parts of a code as an appvar?Do you mean "run" code in an appv?
How do I put parts of a code as an appvar?
:If (getKey(54))∗((H=0)+(H>40))∗(B=0) ;works
:If Y∕256=48 ;works
:1➔H
:Else
:2➔H
:End
:End
:If H=1 ;works
:Y−256➔Y
:If Y∕256=26
:2➔H
:End
:End
:If H=2
:X∕256➔S
:Y∕256➔T
:R➔θ
:Repeat pxl-Test(S,T) ;all this works
:T++
:If θ
:S++
:Else
:S−−
:End
:End
:If H>1
:If H≤40
:1➔P ;works
:Line(X∕256+7,Y∕256,S,T) ;this flashes on, but just once, so doesn't work much
:Else
:0➔P
:End
:If H<15
:Y+256➔Y ;doesnt work
:If θ
:X+256➔X ;but this does (1 time)
:Else
:X−256➔X
:End
:H++ ;i think this only works once.
:If Y∕256=48
:0➔H➔P➔S➔T
:10➔B
:End
:End
I cant tell if this part works or not.Then just
:Pt-On(X∕256,Y∕256,P∗8+Pic1)
:If B
:B−−
:End
:DispGraph
:End
(which works)
lbl m
text(doesnt matter)
dispgraphrr
But this way the grayscale is very pretty but my games goes insanely slow. Am I doing something wrong?
:.M is the level # you are on
:If M
:0->T+768->U
:Else
:(((M-1)768)+1)->T+767->U //<------this is the only part screwing up. U gets stored fine (I think), but T is being weird.
:End
:0->C
:For(r6,T,U
:{Y0+r6}->{L3+C}
:C++
:End
but no matter what I do, It always gets the bytes for level 1, but then it includes enemies for level 2. :(Try putting a * in thereallready tried that, and then I decided to take it out and see if it worked, but it didn't. :(
change (M-1)768
to
(M-1)*768
Hope that helps
[0000000000000]->GDB1
[0000000000000]
[0000000000000]
[0000000000000]
[0000000000000]
[0000000000000]
[0000000000000]
[0000000000000]
I tried writing this:[0000000000000]->GDB1
for(A,0,6)
[0000000000000]
end
You can also do Buff(64)→GDB1 and it'll have the same result as the first one (if you want it to be all zeroes)That's awesome. Thanks.
You can also do Buff(64)→GDB1 and it'll have the same result as the first one (if you want it to be all zeroes)With this method, will the data be stored in the program or in some free ram ?
It's part of the executable, the same way sprites strings etc are.You can also do Buff(64)→GDB1 and it'll have the same result as the first one (if you want it to be all zeroes)With this method, will the data be stored in the program or in some free ram ?
PROGRAM:AIt says beforehand that you can use them as if they were pointers in "the curly brackets and the copy command," so maybe put in the brackets?
:.HISCORE
:"appvMyScore"→Str1
:GetCalc(Str1,Y1)→A
:Return!If A
:Disp {Y1}r
GetCalc does NOT return a
pointer when opening a file.
Its simply non-zero if it
exists in archive and 0
otherwise.
How do I save a variable to a var out of my program. Say str1?Do you mean take the data at a pointer and put in an external var?
And how can I do the opposite too?
I'm already helped by Buttsfredskin and JustCause.How do I save a variable to a var out of my program. Say str1?Do you mean take the data at a pointer and put in an external var?
And how can I do the opposite too?
So what are you unclear on? I'd be happy to help.I'm already helped by Buttsfredskin and JustCause.How do I save a variable to a var out of my program. Say str1?Do you mean take the data at a pointer and put in an external var?
And how can I do the opposite too?
I just had to use an appvar and stuff. If Epic7 still wants to know he can look in the logs of yesterday. There should be also a link to a pastebin that may explain it.
GetCalc(PTR,SIZE) | Creates an OS variable who's name is pointed to in RAM and makes it Size bytes large. Returns a pointer to the start of data, or zero if there was not enough RAM. Overwrites existing variable, even if it was in archive.So, I take it it doesn't ERR:MEMORY anymore? Sometimes an external buffer isn't created, to interesting results 0.o
That's possible on the TI-89T.Which there is no Axe for. Yet./me would like to remind you that he does not have an 89 and runs from any and all dealings with assembly like the insane catboy he is
Quote from: command index http://ourl.ca/8409GetCalc(PTR,SIZE) | Creates an OS variable who's name is pointed to in RAM and makes it Size bytes large. Returns a pointer to the start of data, or zero if there was not enough RAM. Overwrites existing variable, even if it was in archive.So, I take it it doesn't ERR:MEMORY anymore? Sometimes an external buffer isn't created, to interesting results 0.oI'm pretty sure I already asked this somewhere (but can't find it :P) but how can you find out how much RAM is free?
EDIT: Found a note to self (http://ourl.ca/12891/265018) XD "Asm(EFE542) amount of free ram"
which is fasterI'm not sure since the command is new, but remember you could do this too:
x * 2 +3 ->G
x + 2 -> x
or
select( x , +2 ->x) * 2 + 3 -> G
is that even correct syntax? :P
Labels cannot be placed in a single argument for statement.What does this mean?
:some code
:LABEL(
:some more code
this?
For(12)
...some code...
Lbl LBL
...some code...
End
[4A5F68ED->K
[34342545
etc.
(Two Hexadecimals are one tile)[33->{K+20}
And that didn't change anything.Do rectangles clip, or do they behave like lines?I believe they clip properly on the right and bottom sides correctly, but not the top or left sides (probably because it doesn't treat the position coordinates as signed).
Does Dispgraph^rr or whichever one makes 4scale change either of the two buffers?None of the display routines should change any of the buffers
As for your random code, I tried it myself and could not replicate your error, maybe it has something to do with the surrounding code, or what you do with A and B afterwards?I'm not sure, I'm guessing it's some weird delay stuff (maybe like the getKey stuff, but idk?)
Can someone please help me!I just bump this code as it seems to me that it has been overread.
Well, I have a tilemap stored in a Variable in this kind of form:Code: [Select][4A5F68ED->K
(Two Hexadecimals are one tile)
[34342545
etc.
Well, drawing tilemap etc. works.
But now I want to change only one single tile, so i didCode: [Select][33->{K+20}
And that didn't change anything.
If I don't do the K+20 in curley brackets then it overwrites the old tilemap and so that isn't a sollution.
What did I do wrong? Can someone please help me?
But Now I want to edit just one single tile
:If something
:Data(.......)→Pic1
:End
:If somethingelse
:Data(.......)→Pic1
:End
Gives me a duplicate error. (and I know that it should happen)Oh whoops didn't see there was another page XD But yeah, you can have named constants but not named variables, unless you use a constant as a pointer to a variable o.OAhem...
°A-2→°MYVAR
5→MYVAR
MYVAR++
MYVAR*13→MYVAR
Disp MYVAR▸Dec,i .Prints 78
Also, if something is a constant, you can do this in Axe 1.1.0:Code: [Select]:If something
Gives me a duplicate error. (and I know that it should happen)
:Data(.......)→Pic1
:End
:If somethingelse
:Data(.......)→Pic1
:End
Is there a way to get around with it?
:...If something
:Data(.......)→Pic1
:...
:...If somethingelse
:Data(.......)→Pic1
:...
Oh whoops didn't see there was another page XD But yeah, you can have named constants but not named variables, unless you use a constant as a pointer to a variable o.OAhem...Code: [Select]°A-2→°MYVAR
5→MYVAR
MYVAR++
MYVAR*13→MYVAR
Disp MYVAR▸Dec,i .Prints 78
Does that mean I have to count aalll the numbers? :P D:
Well, I need to find another way for 24x24s
Putting them into a pic and uploading to calc distorts it :/
Jacobly converted one of my big sprites but I don't want to bother him with another :P
Or if I write down the binary for the 576 pixels then use a hex converter, but 576 seems like a lot :P
I thinkthanks epic7.
appvBLAH->W
{W}r->A
{W+2}r->B
{W+4}r->C
I think
appvBLAH->W
{W}->A
{W+1}->B
{W+2}->C
Works with 1 byte tho
ALSO
Are tilemaps usually slow?
The speed of the program is about 25-35% the speed of what it was before <_<
:Data({L1},{L1+1},{L1+2},{L1+3}, and so on for about a hundred more variables...
EDIT: problem solved via IRC. :D
I know it moves them over, but I mean does it move the pixels or does it move the actual rows/columns? The ASM program I was talking about shifted my screen down so the bottom seven or so rows were displayed at the top. And for the variables I mean ABC, etc. I already knew about Pic/GDB.
@chattahippie, I can't say much for MathPrint besides I was glad to get rid of it for 2.43 lol. But no, the ASM program was some "power tool" thing, if I remember correctly. Admittedly, I think it was me who told it to shift the screen.I've used those too... but unfortunately, 2.55 forces me to use such scrolling nonsense until I remember to turn off mathprint :P
;DCode: [Select]°A-2→°MYVAR
5→MYVAR
MYVAR++
MYVAR*13→MYVAR
Disp MYVAR▸Dec,i .Prints 78
Darn...
/me is now sad...
Oh well, though. Methinks it's time for arrays, then. Thanks guys.
Is there to do this, but with bitmaps?
[...]->Pic1
[...]
[...]
Pt-On(A,B,Z*8+Pic1)
EDIT:;DCode: [Select]°A-2→°MYVAR
5→MYVAR
MYVAR++
MYVAR*13→MYVAR
Disp MYVAR▸Dec,i .Prints 78
Hope that helps!
What's the size of a 24x24 bitmp?Is there to do this, but with bitmaps?
[...]->Pic1
[...]
[...]
Pt-On(A,B,Z*8+Pic1)
Just replace the 8 with the size of the bitmap data in bytes
How would I combine two strings, such as
"Hello "->Str1
"World!"->Str2
.A guess
Str2->{Str1+6}
Text(1,,Str1)
.^ would that work?
Is there any way to "re-declare" an array? For example, doing "Data(0,0,0)->GDB0" at one point, then doing "Data(6,3,5)->GDB0" later? Or, after the array has been declared, would I need to do something like "6->{GDB0+0}:3->{GDB0+1}:5->{GDB0+2}" to change values?If your program doesn't writeback, then this is okay. It would be much easier to store values to a free RAM space, then alter them there.
Alternatively, you can store data to a variable instead of a constant and then your can re-assign pointers all you want.Is there any way to "re-declare" an array? For example, doing "Data(0,0,0)->GDB0" at one point, then doing "Data(6,3,5)->GDB0" later? Or, after the array has been declared, would I need to do something like "6->{GDB0+0}:3->{GDB0+1}:5->{GDB0+2}" to change values?If your program doesn't writeback, then this is okay. It would be much easier to store values to a free RAM space, then alter them there.
How would I learn tilemapping/scrolling for a platformer? I don't know how to adapt the ones in the tutorials section to make it work. ???I found it difficult to follow Yunhua's tutorial :P
If your program doesn't writeback, then this is okay. It would be much easier to store values to a free RAM space, then alter them there.
Alternatively, you can store data to a variable instead of a constant and then your can re-assign pointers all you want.Ahh, thanks guys!
That's one of the advantages of compiled languages. Larger source code does not mean larger compiled code. You can add line breaks and comments and long-named labels all you want; the compiled code will always be the same size.Cool :)
getKey(2)?X--Evidently not, when I tried something like that it threw an error at compile-time. :/
getKey(2)?X--Evidently not, when I tried something like that it threw an error at compile-time. :/
i think that is becasue X-- is a command, not a value. Try x-1->xThat one has worked for me, even in the conditional.
I have a question: why doesn't this code work? (It compiles, but it glitches on me)(I just had this happen to me too and I spent a couple of hours before getting Runer's help and facepalming.)
0→{S}→{S+5}→{S+15}
and S is the pointer to appvar.
If you're wondering, the optimized way to do that would be:I find it both scary and hilarious how unreadable that is. I can almost guarantee that optimized Axe code will elict a WTF? from the viewer. Even if you're the one that wrote it :P
and 0→{→{→{S}+5}+10}
**************** // Original value of HL; * is either 0 or 1And that's all that's needed to store one byte of zero to {S}. It's also one byte smaller than just using 0 (LD L,0 versus LD HL,0), which is why Runer112 uses it.
and 00000000 // and 0
********00000000 // Final value of HL
Oh I think I've been doing that O.OI have a question: why doesn't this code work? (It compiles, but it glitches on me)(I just had this happen to me too and I spent a couple of hours before getting Runer's help and facepalming.)
0→{S}→{S+5}→{S+15}
and S is the pointer to appvar.
Because of the way Axe optimizes, number→{pointer} returns the pointer instead of the number. The code equivalent to what you are doing is actually this:
:0→{S} :S→{S+5} :S+5→{S+15}
For thatExplained (http://omniurl.tk/6568/218554/) right before you posted, but you probably didn't notice because it was the last post on the page. It's one byte smaller and three cycles faster (but it works only if you're doing something with one byte, as squidgetx said, such as for sin(), xor , or →{}).
and 0->
Is that supposed to be more optimized than
0->
Only if you are storing to a one-byte value.Please do. Everything I know on optimizing is from that :P
I need to update my guide...lool
0→A
DO(A)
Disp "World"
Return
Lbl DO
Z-Test(r1,1)
Return
Lbl 1
Disp "Hello"
Return
:.VELOCITY
:192→θ .begin facing up
:0.0→V .begin stationary
:47.0→X .begin in the middle
:31.0→Y
:Repeat getKey(15)
:getKey(4)-getKey(1)+V→V .press up/down to speed up/slow down
:getKey(3)-getKey(2)+θ→θ .press left/right to turn left/turn right
:cos(θ)*2**V+X^96.0→X .use V and θ to change position
:sin(θ)*2**V+Y^64.0→Y
:Pxl-On(X/256,Y/256)
:DispGraphClrDraw
:End
This Code: [Select] Repeat getkey(15) | Or that: Code: [Select] 0->K |
It's more like an editor, so I think getkey->K is good for this. But if I used both functions, would they still work both fine?They'd work fine, but I'd stick to one or the other for a more standard appearance.
Data(33,34,26,18,35,27,19,36,28,20)->GDB0Data(33,34,26,18,35,27,19,36,28,20,0)->GDB0
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1
Ok I have a feeling I'd be able to firgure this out myself, but it would prolly take a while since I don't remember much from math :Ptan⁻¹(S-X,T-Y)-Z^256<128 should be true if the projectile needs to rotate in the positive direction.
Anyway, so I have a projectile flying at (S,T) with an angle, Z. If Z is zero it faces straight down, 256 degrees, etc.
I have an enemy at, say, (X,Y). How would I check which side of the projectile the enemy is on (right or left), related to the projectile's angle?
Good catch. Thank you!Data(33,34,26,18,35,27,19,36,28,20)->GDB0Data(33,34,26,18,35,27,19,36,28,20,0)->GDB0
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1
Fixed.
tan⁻¹(S-X,T-Y)-Z^256<128 should be true if the projectile needs to rotate in the positive direction.If you had the X and Y velocity (we'll call A,B) instead of an angle, you could ditch the slow trigonometry and use cross products instead!
tan⁻¹(S-X,T-Y)-Ze0 is optimized but returns the opposite.
X-S*B-(Y-T*A)<<0
So [AA00AA00AA00AA0032BB32BB32BB32BB] is equivalent to [AA00AA00AA00AA00][32BB32BB32BB32BB]?Yes.
If two calculators were connected via linkport and both running Axe programs, and 1 calculator wrote 1 into the Port, and the other wrote a 2 into the port, what would each calculator read the port as?0
I know the result can be determined by some sort of binary combination of the two numbers but I can't remember which.(A or B) xor 3 or equivalently 3-(A or B)
:Text(X,Y,"Stuff"[sup]r[/sup]
No, Text() can only write to L6. It's hard-coded into the routine.Dang. I'll have to do some tricky buffer copying. :)
Wait so even if both calculators input the same number to Port (0 and 0 say), they would each read the inverse of that number (3) ? That's weird D:I know the result can be determined by some sort of binary combination of the two numbers but I can't remember which.(A or B) xor 3 or equivalently 3-(A or B)
With Z-Select, does it Goto the label or does it run it as a subroutine?It Goto's the Label
I thought L1 was smaller than 768 bytes?If you first Realloc the variables it makes L1 768 bytes. Perhaps he did that.
No, Text() can only write to L6. It's hard-coded into the routine.Dang. I'll have to do some tricky buffer copying. :)
You don't need to do anything special (unless you are writing an app, in which case it won't work) but you need to have GDB1 defined already. Do you?I don't think so, what do I have to do to make it defined?
Buff(768)->GDB1, or something like that.
Anything that ends in →GDB1 defines GDB1 (a pointer).ah, ok.
:Rect(0,0,96,64)
:RectI(1,1,94,62)
:Rect(0,0,94,62
:For(J,1,94
:For(K,1,62
:Pxl-Off(J,K
:End
:End
RectI(0,,+96,-32)
RectI(1,,+93,-32)
which is faster?
this:Code: [Select]:Rect(0,0,96,64)
:RectI(1,1,94,62)
or this:Code: [Select]:Rect(0,0,94,62
:For(J,1,94
:For(K,1,62
:Pxl-Off(J,K
:End
:End
^^^note that I'm trying to get a border around the screen. I'm not worried about size, just speed.
The first would be much faster. Also, chattahippie that code you posted doesn't do the same thing. Yours creates an empty rectangle with inverted borders. Parser's code creates a white rectangle with filled borders.True, I was assuming parser was starting from a blank screen
X*4->Y
!If Y=4
.stuff
End
to:X*4->Y
!If =4
.stuff
End
is there any way to draw a single column of pixels that's faster than drawing the same column with Pt-On(?Maybe with a rectangle like Rect(X,0,96,1) or something (and if I didn't do any mistake) ?
Redesigned Bitmap() command is clipped, faster, and works with any buffer.So it should be ok :)
is there any way to draw a single column of pixels that's faster than drawing the same column with Pt-On(?If you already use Rect( somewhere else, then you should use Rect(X,0,+1,63).
Method | Speed (cycles) | Code size (bytes) | Routine size (bytes) | |||
Rect(X, and 0,+1, or 255) | 3315 | 14 | 113 | |||
Line(X, and 0,X,63) | 6094 | 17 | 140 |
:Lbl DspSI
:!If r₁≥≥0
:−r₁➔r₁
:Disp '⁻'▸Char
:End
:Disp r₁▸Dec
:Return
:{ᴇ844B} .cursor row
:{ᴇ844C} .cursor column
:{ᴇ86D8} .pen row
:{ᴇ86D7} .pen column
This finds the original copy of the currently running program, then subtracts $9D93; this number is where the running copy of the program is located, so P now holds the difference in address between the two programs.GetCalc(E8478)-E9D93→P
256→{POINTER}r
256→{POINTER+GDB1)r
All this works only if the program isn't being run from archive though, correct?That's true, but in that case you can check if GetCalc() fails.
In general though, it's good to let the user decide through the settings of their shell whether or not they want writeback in their own programs right?My post is actually to make it work when people run the program from the homescreen, which would never write anything back otherwise since it makes a copy of the program to run. Shells almost always write back any program that's in RAM, anyway, and whether it writes back when the program's archived is still up to the user.
I never check for that because unless the program's over 32 KB long, it would do anything since it's probably not writing to RAM. I guess it would help to tell the user that the modification failed, though.All this works only if the program isn't being run from archive though, correct?That's true, but in that case you can check if GetCalc() fails.
GetCalc("appvSTUFF",Y0)
[see what the size of the appvar is]
I've been having some* trouble with the copy command. At least I think it's the copy command. Does it have any bugs or quirks that would cause unexpected behavior? like not being able to use it in a subroutine, or use custom named variables within the command, etc?Post the context in which you are using it, maybe we can see what might be going wrong.
12->SizeX
8->SizeY
copy(SizeX*SizeY->P-1+L1->N,N+SizeX,P)[sup]r[/sup]
Fill(L1,SizeX,2)
copy(95+L1,107+L1,96)r
I can't figure out what is going wrong >.< You might want to hop over to the bug reports and see if anybody familiar with the inner workings of the Copy() function can help figure out what is going wrong.Check the bug reports. Runer just posted the issue.
Hey thanks! But I don't think I'm that good yet.Oh I meant I only ever finished 2 games in Axe and they were Avalanche/Tunnel type clones. :P You'll most likely get further than that :)
:A-(-[negative]2)->A
A random question that I have been wondering:
does the peephole optimizer optimize stuff like this?Code: [Select]:A-(-[negative]2)->A
Was the problem of Pause 0 freezing the calc for 30-something seconds ever fixed, or does it still act like Pause 65536?
:If A
:Pause
:End
or if you use it multiple times:Lbl Pause
:Return!If
:Pause
:Return
Was the problem of Pause 0 freezing the calc for 30-something seconds ever fixed, or does it still act like Pause 65536?Thanks for bringing that up! I agree that its annoying, and so I have finally fixed the problem :) However, as a result, the timing of the pause has changed slightly. In the new pause, 0 is like the old 1, 1 is like the old 2, etc. Basically, it pauses one more unit longer than before, which is usually unnoticeable and so you won't have to change your code.
While 1
.WAIT FOR KEYS TO BE RELEASED
End!If getKey(0)
While 1
.WAIT FOR A KEYPRESS
EndIf getKey(0)
FnOn
Fix 5
0->C
fnInt(IN,0)
ClrDraw
Repeat getkey(15)
Text(0,0,C>Dec
DispGraph
End
LnReg
Fix 4
Return
Lbl IN
C++
Return
[base]->A->C
[exponent]->B
for(theta,0,B)
A*C->C
end
that'll do it but watch out with numbers over 65535.Are the interrupt calls depending on the length of the interrupt function? So if the time of execution of an interrupt is longer than the time beetween the interrupts, will then the current interrupt abort, will the program skip the next interupt or will it be executed right after it is finished?Nope, and that's why interrupts can't take too long, or else it'll keep firing interrupt after interrupt and never return to the program.
Nope, and that's why interrupts can't take too long, or else it'll keep firing interrupt after interrupt and never return to the program.Ok... I tried this and I could abort the program with long interrupts... maybe it was just luck ::)
0->A
Pxl-On(0,0,°A)
Pxl-On(5,0,°A)
???Yes, I believe that should work, that's a cool application for pixel buffering :) Keep in mind that numbers are stored little endian though and so the "pixel coordinates" for X in 0-7 are actually the low byte and 8-15 is the high byte.Ok, thanks. I came up with this idea planning a maze generator were setting bits of variables is necessary, but I just go with adding numbers each time.
Use eulers 'e' to access individual bits. You can also use bit masking combined with shifting left/right (* or / by 2) to read/write bits.You can only use e to read bytes, not write. His method was a way to set, reset, and toggle individual bits in an intuitive way that didn't require masking :D
:[appvData]->Z
:If <new highscore>
:A->Z
:End
:.SAV
:[appvSwords2]->Z
:Repeat getKey(15)
:ClrHome
:Disp {Z}
:{Z}-(getKey(1))+(getKey(4))->{Z}
:Pause 200
:End
Also relating to absorbing appvars, this is kind of an obscure feature, but it would be nice to be able to absorb only certain sections of appvars. Like say [appvAAPPVAR]<<10<<100 to absorb bytes 10 through 100 of appvAAPPVARI can actually see that feature being very useful for pics—absorbing a certain number of rows from a Pic variable.
Pic automatically do that, you just have to change the size of the pic.Oh, I didn't know that. Does it work with tilemap importing too, as in importing the largest multiple of eight rows that fits?
Why does sin(1) return 3 and sin(3) return 11?What should it return? Remember period is 256 and range is [-127,127].
Why does sin(1) return 3 and sin(3) return 11?Axe doesn't use the standard degrees system - it returns a value between -127 and 127.
As far as I know, if you use a custom named variable, it is impossible to modify the location it points to, as it is treated as a constant pointer. It is also impossible to have only a single byte custom variable as far as I know.
Lbl Black
0->r3
Repeat pxl-test(r1+r3++,r2+r3) or pxl-test(r1-r3,r2+r3) or pxl-test(r1+r3,r2-r3) or pxl-test(r1-r3,r2-r3)
End
Return
So, files (Y1 etc) work in Copy() right?
Also say I getCalc(...)→{L1+8}r. In a Copy statement, do I tell it L1+8 or do I somehow specify that it's two bytes? Or does it default to two-byte values?
Hm, how about "What's the syntax for how I do the L# pointer?" Basically how do I tell it that it's a two-byte pointer and not a one-byte pointer.So, files (Y1 etc) work in Copy() right?
Also say I getCalc(...)→{L1+8}r. In a Copy statement, do I tell it L1+8 or do I somehow specify that it's two bytes? Or does it default to two-byte values?
Yes Files work in a copy statement, but what do you mean by your second question? The copy statement copies a certain number of bytes from one location to another
Another, unrelated...The only time that the ++ or -- syntax ever returns the new value is for constant two-byte memory locations (including 2-byte variables). What you want is: !If {{L2+10}++}-8
How far does the VAR++ / VAR-- syntax stretch?
I tried to optimize
{L2+10}++
If {L2+10}=8
to
!If {L2+10}++-8
And it didn't return true when it should in the context I'm using it :P though it did compile without error.
Putting parenthesis around {L2+10}++ didn't have the statement working either. Also tried !If {L2+10}---255 (it's one byte) but it didn't do much.
I'm guessing it's peepholed anyways, but it makes for smaller source and faster typing.
The syntax appears kind of weird, but should this work?
Syntax | Operation | Returns | Notes |
{constant}r++ | Increments the two-byte value at constant pointer constant by one | New value of {constant}r | Exactly identical to {constant}r+1→{constant}r |
{variable}r++ | Increments the two-byte value at variable pointer variable by one | variable+1 if the new value of {variable}r is a multiple of 256, variable otherwise | |
{constant}++ or {variable}++ | Increments the one-byte value at pointer constant or variable by one | constant or variable | Both constant and variable pointer expressions are treated the same way for one-byte increments |
{constant}rr++ or {variable}rr++ | Increments the big-endian two-byte value at pointer constant or variable by one | variable if the new value of {constant}rr or {variable}rr is a multiple of 256, variable+1 otherwise | Both constant and variable pointer expressions are treated the same way for big-endian increments |
0->S
PUS(A,B)
While S
POP()
Pxl-On(P,Q)
If P-95
PUS(P+1,Q)
End
If P
PUS(P-1,Q)
End
If Q-63
PUS(P,Q+1)
End
If Q
PUS(P,Q+1)
End
End
Return
Lbl PUS
ReturnIf pxl-Test(r1,r2)
If S<2500
r1->{S*2+GBD1}
r2->{S*2+GBD1+1}
S++
End
Return
Lbl POP
S--
{S*2+GBD1}->P
{S*2+GBD1+1}->Q
Return
There was a floodfill routine posted earlier that used no extra memory and so can never cause a crash, but I can't find the link anymore D:
Here's one jacobly made
http://ourl.ca/151805 (http://ourl.ca/151805)
"Pic0Pic1Pic2Pic3Pic4Pic5Pic6Pic7Pic8Pic9"→Z
"Pic1"→I
GetCalc("varP")→Q
float{Q}→P
{Z+P}→{I}
"Pic0Pic1Pic2Pic3Pic4Pic5Pic6Pic7Pic8Pic9"→Z
"Pic1"→I
GetCalc("varP")→Q
float{Q}→P
{P*3+Z+2}→{I+2}
"Pic1"→I
GetCalc("varP")→Q
float{Q}→P
(P?-1,9)→{I+2} .Pic1-Pic9 is 0-8, and Pic0 is 9.
"Pic1"→Str1 .Use static instead of varaible data pointers
. whenever possible, they are more optimized
!If GetCalc("varP") .Error handling is important!
.Handle error
.Return or Goto somewhere
End
(float{}??10)-1→{2+Str1} .Omits storing and reloading the value returned by GetCalc()
. and restructures the conditional to omit the else branch
:.AATEST
:"Pic1"→I
:GetCalc("uP")→J
:fPart(J}→K
:K?-1,9→{I+2}
:UnArchiveI
:GetCalc(I)→Q
:conj(Q,{L6},768
:DispGraph
:ArchiveI
:GetCalc("Str1")→V
:GetCalc("uA")→M
:GetCalc("uB")→N
:GetCalc("uH")→O
:GetCalc("uW")→P
:fPart(M}→A
:fPart(N}→B
:fPart(O}→H
:fPart(P}→W
:
:"0123456789ABCDEF"→T
:0→θ
:For(D,0,H/8-1
:For(C,0,W/8-1
:For(F,0,7
:8*pxl-Test(8*C+A→Z,8*D+B+F→Y)
:+(4*pxl-Test(Z+1,Y))
:+(2*pxl-Test(Z+2,Y))
:+pxl-Test(Z+3,Y)
:→U
:{T+U}→{V+θ}
:8*pxl-Test(Z+4,Y)
:+(4*pxl-Test(Z+5,Y))
:+(2*pxl-Test(Z+6,Y))
:+pxl-Test(Z+7,Y)
:→U
:{T+U}→{V+θ+1}
:θ+2→θ
:End
:End:End
:Lbl Count
:0→r3
:pt-Get(r1,r2)
:For(8)
:{→r1}
:While
:Select(,r3ʳ++) and (-1) .subtract not negative
:End
:r1+1
:End
:Return r3
I suppose you could use bit arithmetic with a pointer to a Pt-Get('ed sprite. I'm not too clear on how that would work though.If it's byte-aligned, he could even work with the bytes directly, instead of using Pt-Get(. With that said, the fastest way to find the number of set bits in a byte (which is a necessary part of this) is almost certainly a look-up table. Yes, it's 256 bytes, but it's far faster than any bit arithmetic you can do.
-1->M
L1->X
For(100
If ({X}->V<M)?V=/=0
V->M
End
X++
End
There's probably a more optimized way to write that, but it should work.min(min(A-1,B-1),min(C-1,D-1))+1
The next thing you absolutely need is an Axe Header. You must start the first line with a
period, which is a comment in Axe, followed by the name you want for the compiled
program. If you want a program description, you can type a space and then the
description on that same line, but this is optional. In the above example your program
might look like this:Code: [Select]PROGRAM:MARIOSRC
:.MARIO A fun platformer
:
#Icon(HEX) Key: identity() Tells the parser to replace the default icon with the new icon. The icon must be 64 hex characters long.
Axe calculates it when compiling. (You can optimize it more as {A+L1+200}, by the way. Always put constants after.)Ok thanks :)
aeTIos:
What is the "and" equivalent of ^2 then ?
There is sub(LBL,arg) and sub(LBLr,arg).
There is LBL(arg). But is LBLr(arg) valid ??
How much space does calling "stdDev(PTR,N)" take ??
How much space does calling "sub(LBLr,arg)" take ??
"text"->str1
...
text(0,0,str1)
...
text(0,6,str1)
Twice (or as often you use it). To prevent that, you can doI know how to prevent it, I am just lazy and wanted to know if I had to prevent it or no :PCode: [Select]"text"->str1
...
text(0,0,str1)
...
text(0,6,str1)
this | or this |
...If CST | ...If CST |
code | code |
...End | ... |
:83->°CONST
:
:...If °CONST=83
:.Code1
:...Else
:.Code2
:...End
If °CONST=83, Code1 is compiled, else Code2.Code: [Select]:83->°CONST
:
:...If °CONST=83
:.Code1
:...Else
:.Code2
:...End
:...If CONSTANT_EXPRESSION
:.Code goes here
:...Else
:.Other code goes here
:...
What's the sense of using comment ifs?
I mean, you could just make it normal, I don't think it compiles different on other calcs....
...If °DEBUG
ClrHome
Disp A►Dec,i,B►Dec,i,C►Dec
getKeyʳ
...
There is no Else or End with conditional comments???
:Copy(L1,Str0+1,8)
Lbl Fact
If r1 <= 1
1:Return
End
r1*Fact(r1-1):Return
For some reason, even a simple factorial program did not work correctly for me.Code: [Select]Lbl Fact
If r1 <= 1
1:Return
End
r1*Fact(r1-1):Return
Can somebody post a working sample?
EDIT: In your code, r1 gets overwritten. You need to call FACT as sub(FACTr,r1-1).
Lbl Fact
!If
Return +1
End
Return *(-1Fact())
They are fine with recursion, it just takes a lot of memory the way Axe does it, since it backs up all 6 variables each time you call the routine
My Fibonacci program just causes a RAM Clear, probably due to a stack overflow. Z80 processors aren't very good with recursion, are they?
Where can I find the Freq() function?Yes in fact Axe replaced the Sinreg token by a custom Freq token. It means that the Freq function is at the same place as Sinreg.
Also what do the green Key:Sinreq mean? Is that supposed to be an indication as to where i can find Freq() ?
Thanks for the tip :)That must have taken a long time to scroll, especially if you can't jump to the first letter O.O
The only program in which I used Freq was done through TI-Convert so I just had to type Freq :P
But it is easier to go to the catalog when you don't know where a command is (and if you know which token it replaces)
Well he knew that Freq started with an S (← lol) so he could have jumped to the S.Thanks for the tip :)That must have taken a long time to scroll, especially if you can't jump to the first letter O.O
The only program in which I used Freq was done through TI-Convert so I just had to type Freq :P
But it is easier to go to the catalog when you don't know where a command is (and if you know which token it replaces)
I think Text(...) sets curRow and curCol so the adress would be 844Bh (and 844Ch next).Output(NUM) sets curRow and curCol (home screen cursor position). Text(NUM) sets penCol and penRow (notice the order is backwards for whatever reason), which control starting points for drawing commands.
Copy(L6+672,L3,96)
Horizontal -(L3) //or Horizontal -r
Copy(L3,L6+672,96)
I think you'd have to write your own routine for that.Yes, I tried this. The main problem is that I wanted to shift two buffers so it was very slow.
It's quite slow but you could copy the last 8 rows of the buffer to another buffer, shift that and copy it back.
example with L6 and L3 (if you use them for something else you'd have to use other buffers)Code: [Select]Copy(L6+672,L3,96)
Horizontal -(L3) //or Horizontal -r
Copy(L3,L6+672,96)
768
Asm(EFFD42ED62)
If
Disp "Not enough RAM!"
Else
Disp "768 bytes available!"
End
GetCalc("appvA")->theta
0
Repeat
1
Asm(EFFD42ED62) ;check if there is one at least one byte of free ram
If ; if there is not
1 ;1 is stored to hl
Else
theta
Asm(545D) ;ld d,h : ld e,l
Asm(210100) ;ld hl,1
Asm(EF42F7) ;bcall(_InsertMem)
{theta-2}r++ ;increase size bytes
0:End
End
:GetCalc(E8478)+GDB3-E9D93->Q //Where E is the little E on calc (2ND + , )
This is what 'gets' the highscore at the beginning of the program, but I'm unsure of exactly what all the stuff is for. (and why it's not working for me)
Well, what I would do is creating a str/gdb/pic (w/e) and store the highscore in that since when you write to a string/ w/e ya chose (basically it's the same) you use writeback. I have never really used it, tho.That's currently what it's using, it stores the highscore to GDB3 if i'm not mistaken. I could do it some other way, but the only thing holding me back is how to tell if it is the user's first time running the program, and then to initalize the data respectively, or don't if it isn't their first time.
(This question is directed toward Deep Thought, but if anybody could answer it, that would be great)
I was trying to figure out how to save a highscore within the program, rather than in an appvar, so I looked at the snakecaster source to try to figure it out.
I'm pretty sure that I got everything else working, except for this one line of code.Code: [Select]:GetCalc(E8478)+GDB3-E9D93->Q //Where E is the little E on calc (2ND + , )
This is what 'gets' the highscore at the beginning of the program, but I'm unsure of exactly what all the stuff is for. (and why it's not working for me)
If I recall correctly Deep Thought said it was just a fancy optimization. You can still easily just reference GDB3 the normal way.If I did do that, wouldn't it not work because of
When the TI-OS runs an ASM program, it copies it to $9D95 and deletes the copy when its done. Thus, any changes to the running copy don't do anything.this? ^^^
GDB3-E9D93 is the offset to the high-score value from the start of the ASM program header.So, in my program, I would need a different offset, right? And how would I figure that offset out?
Is it possible to write to the back buffer ?Sadly, no. The text command is an OS routine by TI, so it isn't possible to write text to any other buffer than the main. You have to write it to the front buffer and copy the part you want to the back buffer. If it is a whole line, the copy() function is the right one, otherwise you might have to make your one routine or use the pt-Get() function several times (lot of size and takes some time).
Like Text(X,Y,PTR,L3) (not in the commands)
or Text(X,Y,PTR)r (not in the commands)
or Fix 51 // Text(X,Y,PTR) (not in the commands)
or with any routine you have ?
Ok. Then could an Axiom be written to add a fast text routine that would support any buffer ?Is it possible to write to the back buffer ?Sadly, no. The text command is an OS routine by TI, so it isn't possible to write text to any other buffer than the main. You have to write it to the front buffer and copy the part you want to the back buffer. If it is a whole line, the copy() function is the right one, otherwise you might have to make your one routine or use the pt-Get() function several times (lot of size and takes some time).
Like Text(X,Y,PTR,L3) (not in the commands)
or Text(X,Y,PTR)r (not in the commands)
or Fix 51 // Text(X,Y,PTR) (not in the commands)
or with any routine you have ?
The last possibility would be to use your own font and just 'sprite' it there.
You don't even need an axiom for that. I wrote text routines that were as fast as the OS routine in plain axe. (tho I'm not doing it for ya, sorry: I hate creating 255 sprites for the single purpose of a text routine :p)Yes, but why making it as fast as the OS routine when it can be faster ? ;)
Blame TI for that. If you want to draw directly to the back-buffer, you'd have to make your own font routine, which is easy, but takes forever to get all those letter/number/symbol sprites as well as a lot of space in the program itself. But sometimes a kick-ass font can really improve a game's look! :D
what dot-product method is there? all i can think of is cos(theta) = (u dot v)/(||u|| ||v||), and that would still need arccos
If dx*vy - dy*vx < 0
turnLeft
Else
turnRight
End
EDIT: Oh, I see, that way if FOO translated to {V+17}, you could do something like 23→FOO and FOO→X and both would be valid statements.Yes that's it. It would not save space in any way. It is just so I can easily see who is who in my appvar. Because I have wood, stone and apples (among others) and having this
It would still be no different than using {V+17} everywhere though, since FOO wouldn't actually exist. It'd be more like a macro than anything.
just use subroutines. {SUB()}:Lbl SUB is perfectly valid, and works for both storing and recalling. in your case it will be slightly slower and the exact same size as writing it inline, though (plus extra for the subroutine itself), so i guess i see your point.Yeah, I guess I am going to do that. But you have to admit that {Wood()} is more ugly than just Wood ;)
Pt-Mask draws on the two buffers to get 3 shades of grey.No there isn't. But the reason Pt-Mask has only 3-level gray is that the fourth color/combination is transparent, so you don't need to have always square shapes.
Is there an equivalent to get 4 shades or is it necessary to use two Pt-Off ?
Ok, thanks.Pt-Mask draws on the two buffers to get 3 shades of grey.No there isn't. But the reason Pt-Mask has only 3-level gray is that the fourth color/combination is transparent, so you don't need to have always square shapes.
Is there an equivalent to get 4 shades or is it necessary to use two Pt-Off ?
Indeed.Ok, thanks.Pt-Mask draws on the two buffers to get 3 shades of grey.No there isn't. But the reason Pt-Mask has only 3-level gray is that the fourth color/combination is transparent, so you don't need to have always square shapes.
Is there an equivalent to get 4 shades or is it necessary to use two Pt-Off ?
Wait, for 4 shades, is it like this ?
L3,L6
0,0 → white
0,1 → dark grey
1,0 → light grey
1,1 → black
thepenguin77 made a very nice list of all static RAM locations that can be used by an assembly program without resulting in an instant crash if OS interrupts or some basic B_CALLs are used. It lists what will not work or what will corrupt your data if each section is used, and how to properly restore each section upon exiting so the OS will function properly.Ok, thanks, I'll look at it :)
This list can be found here (http://ourl.ca/16406).
Regarding extra RAM pages, I would imagine a large reason why their access isn't a built-in Axe feature is because they do not exist on the 83+BE, and Axe is quite faithful to ensuring that all programs using the standard commands will work on all 83+ and 84+ calculators.
but I can see how the second one would be useful for saving space in the source program.Not only. In fact, I have I am declaring a sequel of pointers. And in case I forgot to declare one, I would just need to insert a +1→°Var2 between the Var1 and the Var3. Same if I finally want to change the order of my pointers but still want them to be right next to each other.
Maybe you should take that on over to the Features Wishlist. :)Done :)
Could we get Axe speedier?
Axe no longer uses the last 54 bytes as of Axe 1.2.0, so feel free to use L1 to 768 bytes. L2 is more or less stable for the first 800 bytes or so, but remember to run ClrDraw(L2) at the end of your program. Volatility doesn't refer to whether or not your data will get messed up during the program runtime, it refers to how screwed up bits of your OS will get after you quit out of the program (L2 has the chance of messing up tables and such).
It says only 531 bytes, but according to Runer the data after it isn't terribly important to the operating system, so you have about 800 bytes to mess around with.Axe no longer uses the last 54 bytes as of Axe 1.2.0, so feel free to use L1 to 768 bytes. L2 is more or less stable for the first 800 bytes or so, but remember to run ClrDraw(L2) at the end of your program. Volatility doesn't refer to whether or not your data will get messed up during the program runtime, it refers to how screwed up bits of your OS will get after you quit out of the program (L2 has the chance of messing up tables and such).Ah OK, that's really good to know then. And hmm that's itneresting about L2 as it says only 512bytes, but anyway thanks for the information. I'd upvote or thank, or whatever they call it on here but I can't seem to find it... Now onto finishing up the range encoder!(Worst case scenario, estimated as a reduction of ~16% on 768byte thing.)
.AA
ClrDrawrr
Rect(0,0,32,32)r
fnInt(A,6)
.Main
Repeat getKey(0)
End
LnReg
Return
Lbl A
.Pause 75
DispGraphr
..
1→I .The counter
fnInt(A,0) .I increased the interrupt speed for more counter precision
..
Lbl A
DS<(I,4) .Only execute the body every 4 interrupt calls; play with this amount
DispGraphʳ
End
Return .Axe automatically adds a final return if you don't, but it's still good practice to include it
And yes, executing interrupts at exact frequencies is a pain in Axe.
How long does Pause 1 actually last?
For(N)
End
This block of code just executes an empty loop N times, and it will do so at about 13 cycles per iteration.
Also to search : http://megapowers.net/v/search.htm
Forum search is completely disabled because of lag. It was really slow anyway. ;)
If you're interested in on-calc assembly coding, probably the best tool for that is Mimas (http://www.ticalc.org/archives/files/fileinfo/431/43140.html).
If you want to pause for a very small, precise amount of time, I would suggest something like the following:Does the push bc \ pop bc get auto-optimized or something?Code: [Select]For(N)
This block of code just executes an empty loop N times, and it will do so at about 13 cycles per iteration.
End
If you want to pause for a very small, precise amount of time, I would suggest something like the following:Does the push bc \ pop bc get auto-optimized or something?Code: [Select]For(N)
This block of code just executes an empty loop N times, and it will do so at about 13 cycles per iteration.
End
.Deletes the bullet at index r₁ (0-indexed)
.Updates bullet total N
Lbl Del
Copy(N--*6+<list_start>,r₁*6+<list_start>,6)
Return
There's a pretty ingenious (at least I thought so when I learned it years ago) way to handle this. Keep track of the total number of bullets with some variable. When you add a bullet, increase the bullet total and put the new bullet at the end of the list of bullets, which should be at the memory location old_total*6+list_start. This all probably seems pretty standard. But the trick is in bullet removal: decrease the bullet total and move the data for the last bullet in the list into the position of the bullet that was just removed. In Axe, the code for that might look something like this:Code: [Select].Deletes the bullet at index r₁ (0-indexed)
.Updates bullet total N
Lbl Del
Copy(N--*6+<list_start>,r₁*6+<list_start>,6)
Return
For(I,0,18)
Pt-On(X,Y,Pic00+I)
End
Quick question, is there a way to loop through static variables? For example, I have 19 sprites Pic00, Pic01, Pic02,...,Pic18, and I'd like to display them horizontally across the screen (until it reaches the edge and go to the next column).You already got the answer, but I wanted to precise some things. I think that your problem comes from the fact you said "static variables".
I've read somewhere that you can useCode: [Select]For(I,0,18)
Pt-On(X,Y,Pic00+I)
End
But all I got is the first sprite pressed down and spread across the screen (think of butter or shift drag in MSPaint).
.CONC
.Setup sprites
[FFFFFFFFFFFFFFFFFF81BD959D8581FFFF81A19DA1BD81FFFF81BDA5BDA181FFFF81BDBD858581FFFF8191BD919181FFFF81A199998581FFFF81BDBDBD9981FFFF81BDA5A59981FFFF81A599A5A581FFFF81BDBDBDA581FFFF81A5BDBDBD81FFFF818199998181FFFF8199A5A59981FFFF81BD9D8D8581FFFF81BDB9B1A181FFFF81858D9DBD81FFFF81A1B1B9BD81FFFF81BD99999981FF]->Pic0
DiagnosticOff
ClrHome
.DRAW
0->X:0->Y
For(I,0,35)
If X>88
0->X
Y+8->Y
End
Pt-On(X,Y,I*8+Pic0)
X+8->X
End
DispGraph
.LOOP TILL ENTER
Repeat getKey(9)
End
Ouch. You should do that :Code: [Select][FFFFFFFFFFFFFFFFFF81BD959D8581FFFF81A19DA1BD81FFFF81BDA5BDA181FFFF81BDBD858581FFFF8191BD919181FFFF81A199998581FFFF81BDBDBD9981FFFF81BDA5A59981FFFF81A599A5A581FFFF81BDBDBDA581FFFF81A5BDBDBD81FFFF818199998181FFFF8199A5A59981FFFF81BD9D8D8581FFFF81BDB9B1A181FFFF81858D9DBD81FFFF81A1B1B9BD81FFFF81BD99999981FF]->Pic0
[sprite1]->Pic0
[sprite2]
...
[sprite18]
That'd be much more readable and easier to edit. ;)
Quick question, is there a way to loop through static variables? For example, I have 19 sprites Pic00, Pic01, Pic02,...,Pic18, and I'd like to display them horizontally across the screen (until it reaches the edge and go to the next column).
For(I,0,11)
Pt-On(I*8,0,I*8+Pic00)
End
N00B QUESTION ALERT:It's a compiled language for the 83+/84+ series. What this means is that Axe code gets compiled into machine code using an app. The advantage of using Axe over assembly is the lower learning curve.
read with cation as this may cause serious to fatal n00bism.
What is axe???? I'd like to learn...
(p.s. How do you get spoilers in replies?)
:w00t:
getcalc("appvMAP,10")->A
For(X,0,9)
0->{A+X}
End
1->{A}
For(X,0,9)
Output(0,0,{X+A}>Dec)
End
Hmm... being able to see the real code could be helpful. I believe there are some copying errors in that code, like the size argument of GetCalc() being inside the quotation marks and the value outputs all overwriting each other. :P
Also, that doesn't solve any problem, but you may want to check the Fill command out instead of using a For loop to set a bunch of bytes at 0.
Now your code seems to work on Wabbit (once I put the quotes at the right place), I don't see any problem, it displays a 1 then zeroes.
Also be sure that the appv is the appv token, and not a "a" followed by a "p", ...
Yes with a For loop.While I do appreciate any help...I have no idea how a for loop could possibly improve handling of getkey routines. Could you perhaps elaborate on how to use it? (Not the for loop, I can use those fine, using it for a better input routine).
---------------------------------------------------------------------------------------------
New(PTR,OFS,SIZ) Arguments: PTR = Pointer to start of program/appvar (from getcalc).
OFS = Offset in program to add memory
SIZ = Size of memory to insert
Returns: 0 if it failed, non-zero if it succeeded.
Description: Attempts to inflate the size of a program/appvar
---------------------------------------------------------------------------------------------
Delete(PTR,OFS,SIZ) Arguments: PTR = Pointer to start of program/appvar (from getcalc).
OFS = Offset in program to start deleting memory
SIZ = Size of memory to delete
Returns: 0 if it failed, non-zero if it succeeded.
Description: Attempts to shrink the size of a program/appvar
---------------------------------------------------------------------------------------------
More random questions...
What would be the best way to get text() functionality without actually using the command (speed reasons)? My first thought is to just tilemap the screen and have sprites be letters. However, depending on how many different characters I use, this could end up being a lot of sprites to define. Are there any better methods out there?
I would imagine the text command is faster looping through a map :-\ you have Fix 5 in your program right? Cause if your putting your text on the buffer and using dispgraph once at the end then it isn't that slow.Not as slow, but still very slow. This is due to the OS's _vPutS routine.
I just got a stupid idea. Why not make an early version of Axe for CSE that would be exactly the same as the current Axe, but with changed DispGraph (and DispGraphr and caetera) so that it displays a stretched L6 (and L3 and caetera) on the screen ?
(A) While a full-screen update on the non-color calculators takes about 1/100th of a second and almost everything that uses it relies on it being fast, a full-screen update on the color calcs takes about 1/5th of a secondYeah but we could cheat with some frameskip and with the double-pixel trick. Moreover, some coders (like matref and I, or Builderboy and others) still have the possibility to trigger the 15MHz mode to get more speed on the CSE without losing any compatibility this time, so our programs of course will have speed issues, but also some speed gains.
(C) why not just use a non-color calculator in that case.That's not for me, that's for people like MacBernick or dreamdragon who only have a CSE and may want games on it. So of course, giving them the old games is not the best to do, but that can help them wait.
The CSE will not have L3 and L6 for temp LCD buffers. 128 KB of RAM isn't even enough to store 320x240 (2 bytes) of data.But we are not talking about storing 320x240 bytes of data, still 768. We are asking to for 94x64 monochrome support, like somehow a "retro-compatibility mode".
(A) While a full-screen update on the non-color calculators takes about 1/100th of a second and almost everything that uses it relies on it being fast, a full-screen update on the color calcs takes about 1/5th of a secondYeah but we could cheat with some frameskip and with the double-pixel trick. Moreover, some coders (like matref and I, or Builderboy and others) still have the possibility to trigger the 15MHz mode to get more speed on the CSE without losing any compatibility this time, so our programs of course will have speed issues, but also some speed gains.
Also that depends on the program you are porting because I don't think AudaciTI will have too much issues with refreshing since nothing happens on the screen except menus :P
So with an 8 by 8 sprite you use Pt-Change() to draw it inverted. How do you do that with a 16 by 16?Since Axe doesn't have any 16x16 sprite routines (at least as far as I could tell according to the official documentation), you have to do it by drawing four 8x8 sprites. So if Pic1 is the top-left corner of the 16x16 sprite, Pic1+8 is the top-right, +16 the bottom-left, and +24 the bottom-right, then you'd want to do something like this (assuming drawing to X,Y):
Pt-Change(X,Y,Pic1)
Pt-Change(X+8,Y,Pic1+8)
Pt-Change(X,Y+8,Pic1+16)
Pt-Change(X+8,Y+8,Pic1+24)
min(0,-1) .return 0 (0<65535)
max(-1,0) .return -1
min(-1,5)r .return -1
max(-8,9)r .return 9
.db REP_ABS
.org $-1
ld hl, sub_axiom10
ld (someVar), hl
But it doesn't seem to work : when in the Axe code I replace somevar by the axiom function itself it works. I have REP_ABS = $49. What am I doing wrong ?Does using #ExprOn in a program affect axiom too ?
I mean, if an axiom use the axe multiplication and the program calling axiom command have #ExprOn, does the multiplication will be optimize for speed too ?
Isn't there a way to,simply call sub_mulFast instead of sub_mul ? Apparently axioms always compile in #ExprOff mode, no matter what the state of optimization is when they are parsed.
I would recommend SourceCoder (http://sc.cemetech.net/). Simply upload the image and voila, tons of output formats, one of which should be plain black-and-white image hex.Thank you runner, that did it.
You can convert it to a .8xi file with TI-Screen Capture (see TI-Connect/Tools) and send it to your calc. From there, include [PicX]->Y, where PicX is whatever Pic variable you stored your bitmap in, and Y any Axe variable or static pointer. You'll need the said Pic variable every time you'll compile your program, but you can archive it. It's exactly the same as typing it in in hex, just a hundred times less annoying.This would be really nice because it would save space, but it doesn't work when I try. After I store it to my variable, do I use the bitmap command?
Something to get rid of all downsides could be to use TI-Screen Capture to convert as a Pic, then use TokenIDE and Wabbitemu to quickly coin a program that converts the Pic into an appvar.That's a smart idea; you could get as many pics as you need and not be limited to ten.
Since it's a classical image, you can do DispGraph(pointerToThePic) to display it immediately, or Copy(pointerToThePic) to copy it to L6. Bitmap() won't work since you need a header.QuoteYou can convert it to a .8xi file with TI-Screen Capture (see TI-Connect/Tools) and send it to your calc. From there, include [PicX]->Y, where PicX is whatever Pic variable you stored your bitmap in, and Y any Axe variable or static pointer. You'll need the said Pic variable every time you'll compile your program, but you can archive it. It's exactly the same as typing it in in hex, just a hundred times less annoying.This would be really nice because it would save space, but it doesn't work when I try. After I store it to my variable, do I use the bitmap command?
.RUN
ClrDraw
DispGraph([Pic1])
Repeat getkey(15)
End
Ok I found this Asm(E7FDCB08CEEF9B4AFDCB088E) but it only executes programs in the program menu but I was hoping that I could execute a string instead. :/ Maybe I could create a string and copy it to a temporary program and execute that.
Do the input and prompt commands still work when run through axe?
:"prgmA"
:asm(hexcode here)
Hello, I'm new here and I need some help of authorized personal:). Ok, first, I'm afraid of overwriting something important in my TI 83's memory.If you have a TI-83 it will be hard to use Axe on it. :P
:.Lowrcase
:DiagnosticOff
:Lbl 00
:ClrHome
:3->A
:Output(0,1,"Lowercase")
:Output(2,3,"On")
:Output(2,4,"Off")
:Output(2,5,"Quit")
:2->B
:While 1
:Pause 200
:Output(1,A,">")
:Output(1,B," ")
:If getKey(1)
:A->B
:A+1->A
:End
:If getKey(4)
:A->B
:A-1->A
:End
:If A>5
:3->A
:5->B
:End
:If A=3
:If getKey(9)
:Goto ON
:End
:End
:If A=4
:If getKey(9)
:Goto OF
:End
:End
:If A=5
:If getKey(9)
:Goto ST
:End
:End
:End
:Lbl ST
:ClrHome
:Return
:Lbl ON
:Asm(FDCB24DEC9)
:ClrHome
:Disp "On"
:Pause 3000
:Goto 00
:Lbl OF
:Asm(FDCB249EC9)
:ClrHome
:Disp "Off"
:Goto 00
:Asm(FDCB249EC9)
You should be able to get it to work if you remove the C9
Yup. Little endian going on. You need to reverse the bits.*bytes. You don't have to reverse everything, just the two bytes ;)
:While 1
:EndIf getKey(54)
:While 1
:EndIf getKey(54)=0
:While 1
:EndIf getKey(54)
:While 1
:End!If getKey(54)
They should both work IMO, any ideas?I think that I understand everything except of the Pt-Off(0,A++^8+Pic1Except if you have a real 83+ (I mean not a new 83+.fr which is a 84+SE), I'd advise to close parentheses, brackets, etc. Keeping them open doesn't optimize anything in the compiled program and is just asking for bugs from the compiler (even though the compiler should work, but it's better not to tempt it) ;)
GetCalc("appvDATA",Y0)
.Y0 is the function token, it specifie the file you want to put the appv in. You have 10 file (Y0-Y9)
{Y0-2}r->A
.A will hold the size of the appv, stored 2 byte before the start of the appv.
.Next line will create a temporary vars (delete at the exit) with the size of the appv
GetCalc("tmpDATATMP",A)->P
Copy(Y0,P,A)
.this is allowed, but not everything can be done with file. (like 0->{Y0}r)
.P is now the pointer to appv.
Also it's in the PDF IIRC. :P There's actually more than Y0-9 but they have different purposes that I don't remember exactly and they're not in the doc, only in the changelog.
For(C,0,{GDB2})
4*C+GDB2->E
<stuff with E>
End
This does none of the modifications while the following does the first one:For(C,0,{GDB2})
4*C+GDB2->E
4*0+GDB2->E
<stuff with E>
End
Which makes absolutely no sense to me as in the first run C will be equal to 0 and it should be able to do the first one.the stuff is this:
nib{E+1*2+1}->D
({L5+11} and D=D and ({L5+10}>=nib{E+q*2}) and (N={E}))?{E+3}->{L4+{E+2}}
It is less than 2000 bytes large...What Sorunome means is that apps are always 16384 bytes (we are talking about one page apps, the ones Axe can produce), so if you have more than 16384 bytes in your code, it will not compile, and if you have less than 16384 bytes, it will compile into a 16384 bytes app so you need 16384 bytes of free space.
"PTR"→Str0
!If Equ►String(<string>,Str0)?-3-Str0
.Starts with "PTR"
End
Copy(<string>,L₁,3)
0→{L₁+3}
.Substring at L₁
Is there any way to garbage collect in axe? My current program has to archive programs a lot and I want it to automatically garbage collect when necessary (like DoorsCS does).I think this is done automatically in the "Archive" command. When necessary, the "GarbageCollect ? Yes/No" menu appears. I am not sure though but I think.
Also, is there a way to change the size of a program without creating a new program and copying the old?This can be done with MEMKIT (included in the zip) if your program is unarchived.
I think this is done automatically in the "Archive" command. When necessary, the "GarbageCollect ? Yes/No" menu appears. I am not sure though but I think.It brings up the menu. I want a way to skip the menu (because it messes up if the user clicks no) and garbage collect on its own :/
This can be done with MEMKIT (included in the zip) if your program is unarchived.Hmm, I guess no way if its archived then?
It brings up the menu. I want a way to skip the menu (because it messes up if the user clicks no) and garbage collect on its own :/
Hmm, I guess no way if its archived then?
.ERROR
ClrHome
While 1
ReturnIf getKey(41)
ClrHome
If getKey(26)
Disp ,"[2] key pressed."
End
If getKey(28)
Disp ,"[8] key pressed."
End
Pause 300
End
Yes, just make sure that that only works if you do NOT compile it as an app and that you would change program code if you were to accidentally write too far than you setted your area
Well apps can be max 16384 bytes largeHe's not compiling as an app, that's the problem.
This has been reported and fixed (you'd have posted 1 day later it would have been one year ago exactly :P) here (http://www.omnimaga.org/the-axe-parser-project/bug-reports/msg367215/#msg367215). The dev build also fixes some other bugs you have not come into so upgrading is recommended ;)Awesome, works like a charm. Thanks!
How do I get 3/4-level grayscale to not flicker? Interrupts?You can achieve awesome grayscale with runers GrayLib (http://www.omnimaga.org/ti-z80-calculator-projects/(axe-library)-graylib-(nearly)-perfect-grayscale/)
If I use both at once, how do I get it to not flicker?
What is recommended way to get higher-levels grayscale?
OK I'll look into graylib.
How do I get many-level grayscale? I currently have two 4-level's I switch between every other frame, creating a period of 6. And it turns out I currently have 7-level grayscale using only 3 buffers, which is the maximum possible with a period of 6. Yay!
Is it possible to do even better, say even more colors? Will it flicker horribly?
How do I minimize flickering, with, say 7-level? As in distribute the "pulses" to maximize "frequency", so it's not on for 3 frames and off for the next 3, but instead switches every other frame? I'm not sure how my current solution behaves regarding pulse distribution.
IDE
- SourceCoder (http://www.cemetech.net/sc/) : Browser-based TI-BASIC editor and image converter. Directly links with jsTIfied.
- ★ TokenIDE (http://www.ticalc.org/archives/files/fileinfo/433/43315.html) ★ Windows-based TI-BASIC editor with an Axe token set and sprite/image editor. Works on Linux with Mono.
- IES (http://clrhome.org/ies/) : Browser-based TI-BASIC editor with an Axe token set and simple picture editor.
asm(EFE542EF9247EF5641EFBF4AC9)
store the value to a variable and display it as a decimal:->A
Disp A›Dec
1) how do I seed the random numbers generator?
2) once seeded will the rng always return the same stream of numbers?
-snip-Well I might need it for a sandbox game prototype ime working on. You now, seeds.
This has always bothered me, really... would people be interested in it being replaced with a deterministic PRNG?
I don't understand what the r1 pointers (found under the vars>polar menu) are used for
1) how many cpu Cycles does it take to read a byte from a file like {y1}
And doing exp》{y1} automaticallysagves it to the appvar that very instance right?
-snip-Alright. The only problem is that the data imd working with will likely be bigger then the amount of ram. Well actually it probably won't, but it will be very close. So i decided that the best thing to do would be to keep the data in a buffer temporarily, and when a different sector is required, to write the buffer back to the archive and load the new data. The "data" is a tile map for a minecraft clone, so there is a lot. Is there any way i can keep the var archived and still use my buffer approach?
When reading from archive, does it disable interrupts as well?I believe so as interrupt based greyscale has to be reloaded after the file-IO in my project imd working on. Idk if the culprit is the archive / unarchive command thou.
When reading from archive, does it disable interrupts as well?
Also, is there a really fast way to get a user to input a variable? It takes too long to make one from scratch every time.
Is there any way i can keep the var archived and still use my buffer approach?
When reading from archive, does it disable interrupts as well?I believe so as interrupt based greyscale has to be reloaded after the file-IO in my project imd working on. Idk if the culprit is the archive / unarchive command thou.
No. Keeping it archived means reads are still slow. And even if you did manage to speed up the archive reads, you still couldn't write backSo no matter what what I am forced to store a copy to ram? :'( come on runer use don't you use your magic to come up with anything? ??? :'( :'( couse keeping a 32*384 tile map in ram just seems wastfull...
Instead of being rude, just use your brain and understand that it is reading from archive that is slow, and that there's nothing you can do about it. It seems wasteful ? Too bad, you can only do that.Umm i was not trying to be rude... i was sad that you that was the only thing you can do... notice the cry emicons... If you think it was rude, then i apologize.
come on runer use don't you use your magic to come up with anything?just sounded to me like "come on Runer if you're so clever why don't you have a solution for this ?". I understand now that that is not the case so I apologize for my wording.
-snip-Thanks you kind sir, i understand why you would have thought i was trying to insult runer. I am going to add a footnote to my post ATM to prevent further misinterpretation.
When using getKey^^r, are interrupts still working?As far as I know not, if you use interrupts you have to manage without that.
Are you not supposed to load a file onto an existing file? Like, if I put appvHELLO to [Y2] and then do appvHELLO2 to [Y2], does it break some stuff, because when I tried to read another file in [Y1], it doesn't work anymore, program crashes after having the run indicator turn on and then pressing any button.
There's no simple way to produce "nice" audio. At least, not without heavy, very specialized assembly code that would only run on the 84+. Such code doesn't really fit into Axe as a built-in, and that's not even considering the fact that "nice" audio has only ever been implemented by a few people.
If one such individual knows what they're doing, they could theoretically make an Axiom/library for it.
Is there a way to flip masked sprites? When I try to flip something ( Pt-Mask(x,y,flipV(Pic0)) ) it comes out wrong.The problem is that maked sprites have two layers, each 8 bytes. FlipV() can only flip one layer. You will have to flip each layer individually, storing the output to a buffer and then doing Pt-mask on that buffer. The code will be something like this:
Copy(flipV(pic0),L1,8) .flip layer 1 and copy to buffer L1
Copy(flipV(pic0+8),L1+8,8) .flip layer 2 and copy to buffer L1+8
Pt-Mask(x,y,L1)
Note that this will overwrite any data you may be storing in L1 throu L1+16
There's no simple way to produce "nice" audio. At least, not without heavy, very specialized assembly code that would only run on the 84+. Such code doesn't really fit into Axe as a built-in, and that's not even considering the fact that "nice" audio has only ever been implemented by a few people.
If one such individual knows what they're doing, they could theoretically make an Axiom/library for it.
No one has made an Axiom for that? That's surprising.
I must axe you a question ;D does the increment operated follow the left to right order of ops exactly? I mean will something like if foo=x++ increment x first and then compare, or the opposite? (In my case foo is a number of arithmetics)
I must axe you a question ;D does the increment operated follow the left to right order of ops exactly? I mean will something like if foo=x++ increment x first and then compare, or the opposite? (In my case foo is a number of arithmetics)
In most of axe, since there is not exact documentation and that it does not follow order of operations, most things you just need to test to see if it works or not. (Btw, it wouldn't even compile, just throw an invalid token error)
On a different subject, I noticed that the Text( command behaved weirdly when performed off screen.
Could this just be my bad code or is it something else?
Also, what exactly does #Relloc( do? (I know it moves the location of something, but why would you want to do that?)
Now that I think of it. I never used #Realloc because I use custom variables (and because before that, I was a noob) but would Realloc also move a custom variable if it is defined from a default one ? I mean something like °A→°Custom, then #Realloc(L3), would this make °Custom equal to L3 from now on ?
You noticed correctly. Text printing is handled by the OS, which may freak out when attempting to print text offscreen. It's up to the programmer to make sure that the text they print is not offscreen.I hate that. It would be much easier if the OS handled the screen text itself, and IMO, much more optimized to. (Compare the OS having some code like If((x=(x+char.length))>=screen.width) return; vs the programer having to come up with some hacky code :P
That text crashing was due to how arabic text width may get smaller with more chars, so not a possibility here ;)That is what I meant- when the string was truncated to fit on the screen, it got bigger and went even farther of the screen ;) Unless I misunderstood something :P
Does anyone know if writing to archive is bad for the memory?The flash memory wears down after about 100000 writes to it. Reading does not damage it though.
I have heard that repeatedly writing to archive will eventually damage it.
On a different subject, how do programs like Doors find the names of all the programs (and how can I do that in Axe)?
Does anyone know if writing to archive is bad for the memory?
I have heard that repeatedly writing to archive will eventually damage it.
On a different subject, how do programs like Doors find the names of all the programs (and how can I do that in Axe)?
Is it possible for a pointer to move itself as in A +10 -> A?
I am using A as the pointer to a program.
I am trying to be able to read programs longer than 2^16 bytes.
I have been hunting around and I can't seem to fine a good tutorial on how to use the VAT.
Can anyone give me a good tutorial? (I got lost at reading backward)
Also, does anyone have a list of all the OS memory location? (like the VAT is E9830 and E982E and the text pen is E86D7 and E86D8)
Thanks! ;D
What is the proper way to send data from one calculator to another?
The Command List says "Send(" can send a byte, which is a number 0-(2^8)-1, but when I try to send a Variable and get the Variable with "Get->A"
A doesn't have the value that was sended.
I did loop Get, until A≠-1 but A wont change...
I did use the mini USB port.
And I have to use the mini USB because the guys wnating to play the game(thats what im trying to create)
only have the mini USB link cable.
Is there really no way to send any data with that cable?
How can i convert, in axe, a wavelength (Freq() uses wavelengths, right? :P ) into a string like "C4" or "C4♭" and back?
Is there a tutorial for getting ans if it is a list/other var? TBh, idk what the ans var is called in the VAT :PTo document an answer to my own question, you can get a ptr to the ans var by doing getCalc([00720000]. To load the type of the var ans into hl (axe 'ans'), do (in asm) bcall(_RclAns) \ and $1F \ ld h, 0 \ ld l, a, or Asm(CDD74AE61F260065) in hex.
Sorry to interrupt with a different question, but when I display a token, it displays the basic token.I dont know how you call the catalog, but i when you do, the axe tokens should be there ;)
Like instead of displaying #Axiom( is displays AsmComp(.
Is there an easy way to display Axe tokens instead (probably by intercepting whatever Axe sends to the basic editor)?
Also, is there a way to call the OS's catalog? (I don't want to make my own.)
Sorry to interrupt with a different question, but when I display a token, it displays the basic token.
Like instead of displaying #Axiom( is displays AsmComp(.
Is there an easy way to display Axe tokens instead (probably by intercepting whatever Axe sends to the basic editor)?
Also, is there a way to call the OS's catalog? (I don't want to make my own.)
To continue my long string of questions I can't seem to find the memory address of the BASIC graph.
I assume I can treat it as just another buffer.
It isn't really important I am just curious how some asm programs edit the graph.
It works!
I finally understand why each of the free ram variables have a name under them!
Since L5 (textShadow) is 128 bytes each one should holds a value for each number on the screen!
And it is corrupted by ClearHome because ClearHome is the same as Fill(L5,128,0) and the same is true for L6 and ClearDraw
(My life has meaning now)
Is all of my information correct (I posted as soon as I saw this because I was excited)
Thanks SO much! ;D
(increases karma)
Is there an equivalent of pop and push for axe?
Realloc( doesn't seem to do anything.
I was just curious if there was a way to reuse letter variables.
Hrm... Relloc(A) gives an error.
Is there a way to access the OS's unused spaces?
When I downgraded from 2.55 the new os took up 200k less space.
Is there a way to access this unused space (my available archive didn't go up when I downgraded)
While debugging my program editor I opened a weird file (it uses the VAT to select a file) and it contained my last entry.
After experimenting with it I found that I could access it with a Getcalc([0523]) -> var and that modifying it did indeed modify the OS's last entry. (It seems to use tokens to store data.)
Is there a way to execute this modified entry so I can use the OS's math or run a program? (or just reset my ram)
I love poking into places that I shouldn't! :angel:
Is there any useful uses of it?
I am assuming that the OS has a flag for whether the enter key is pressed on the home screen.
It there a way I can "activate the flag" and execute anything it has.
I am looking for a way to implement floating point math (It doesn't have to be fast) into my editor as a feature.
Basically I am tired of quitting my program to do a math operation on the home screen. (and I don't want to do long math in my head)
Thanks!
(the whole home screen is a program thing BLEW MY MIND)
Is there a way to re-size an appvar? I was hoping to just use x -> {ptr-2}r but that didn't work.
(I know about making a new one and copying, but My appvar can get bigger than half of max RAM)
Thanks!
I may wind up using memkit...
:Goto (GetCalc("prgmNAME"))Will fail of your program contains any sort of jumps in it <_<
Do I need to make space for it, or can I just copy a program directly to it?Well, the 'program that ran it' sould be an app...
Copying it directly doesn't work.
Never mind, I messed up the copy statement.
Edit: the program runs fine but crashes when exited (the program in e9D93 not the one who ran it)
I am just looking back (after going off and working on random things) on my attempt on an small font editor.Is there any useful uses of it?
I am assuming that the OS has a flag for whether the enter key is pressed on the home screen.
It there a way I can "activate the flag" and execute anything it has.
I am looking for a way to implement floating point math (It doesn't have to be fast) into my editor as a feature.
Basically I am tired of quitting my program to do a math operation on the home screen. (and I don't want to do long math in my head)
Thanks!
(the whole home screen is a program thing BLEW MY MIND)
However you'd end up doing such a thing, you'd need some things beyond the capabilities of pure Axe. My inclination would be to let the user select a line, or some more specific selection, and then press a button to request that it be replaced with its evaluation. I've never done anything like this before, but it might work something like this (DISCLAIMER: COMPLETELY UNTESTED):
- (Optional) Save the value of Ans. This gets rather tricky for lists and matrices.
- Create a temporary equation with the same size as the selection. The clean way to do this in assembly would be to use B_CALL(_CreateTempEqu) (http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:432D). But a pure Axe solution would be to use a fixed temporary equation name, like [03FFFF00], and create it with GetCalc(<name>,size).
- Copy the selection into the temporary equation.
- Install an error handler around the next step in case an error occurs while parsing the equation. DrDnar's axiom (https://www.omnimaga.org/the-axe-parser-project/(axiom)-run-(unarchived)-external-assembly-programs/) meant for running assembly programs seems to provide this functionality.
- Execute the temporary equation by putting its name in OP1 and using B_CALL(_ParseInp) (in Axe: <name>Asm(E7EF9B4A)).
- If an error occurred, handle it as you wish. Perhaps append "=ERROR" to the selection.
- If no error occurred, convert the result to a string representation. Thankfully, Mateo recently demonstrated (https://www.cemetech.net/forum/viewtopic.php?p=242910#242910) how this could be done. In Axe (returns a pointer to the variable's size word): Asm(210000EF2443D5EF6949EF524BEFAB49EF6C49E1).
- If no error occurred, delete the selection and insert the result's string representation into the program at that location.
- (Not sure if necessary) Clean up temporary variables with B_CALL(_CleanAll) (in Axe: Asm(EF5041)).
- (Optional) Restore the original value of Ans.
Perhaps this just got lost in the manual copying process, but is ax1end defined properly?Yes I did forget to add it.
If it appears so, nothing seems obviously wrong to me. If you posted the assembeld axiom, I could probably figure out what's wrong, though.
Does Axe not allow you to manipulate more than one appvar at a time? I'm getting some really strange bugs when I do. I have 2 appvars that I create in RAM. One is the appvar for the current generated floor in my game. The second appvar is supposed to be another map that I am going to use in my AI calculation that I call DistMap. I running across several strange bugs with Axe when I do this. If I create both appvars at the same time, I am no longer able to manipulate the DistMap appvar if I do anything with the Floor appvar. In this case all I am trying to do is fill it with some value for now. If I instead create the DistMap appvar whenever I press a button (down in this case), the tilemap gets corrupted somehow. Or rather, it seems as if the 2 pointers are getting mixed up somehow. Because when I try to move down a bunch of corrupted tiles are scrolled in instead. Any ideas?
~8->{°MobOX+Mob}
Later on I call a function that looks like this:Lbl AnimateMob
For(I,0,Mobs-1)
°MobArray+(I*4)->Mob
If {°MobOX+Mob}>>0
{°MobOX+Mob}--
End
If {°MobOX+Mob}<<0
{°MobOX+Mob}+1->{°MobOX+Mob}
End
If {°MobOY+Mob}>>0
{°MobOY+Mob}--
End
If {°MobOY+Mob}<<0
{°MobOY+Mob}+1->{°MobOY+Mob}
End
End
Return
However, despite being a signed comparison, it still treats {°MobOX+Mob} as some large number and decrements it instead. I've used the sign{} command but that only breaks it further. How do I do this? It's starting to feel like I really have to fight the language to do simple things. I've hand calculated the offsets so nothing is off there when I draw. It is literally not working with negative numbers. I've subtracted 8 instead, I've changed the comparison from signed to unsigned. I'm really at a loss here. Please help!
-8→{°MobOX+Mob}
Is storing -8 as an 8-bit number.L1+00->->°MyVar
Then you can use it as a variable in any way like so:42->MyVar
Any custom variable you create will always be 2 bytes in size.