I am working on a Axe rpg, and need to move the map to an appvar. It is a 72 * 32 matrix stored in GDB1. I made the appvar with the map in in using TokensIDE, but I do not know how to incorporate in into my programs. Could someone give me a hand? :)
Well, you probably don't need to move the matrix to an appvar, you want it to start out in the appvar! To get create an appvar with your matrix, use something like this:
.A
[YOUR MATRIX HERE]->Str1
72 * 32 -> S
Copy(Str1,GetCalc("appvNAME",S),S)
Compile and run the above program, it will create an appvar with your matrix.
Then, to use your matrix in your program, insert this line near the beginning: GetCalc("appvNAME")->X where X is a variable of your choice. Now, to access your matrix, simply use X in the same way as you would GDB1
Sidenote: your matrix is not "stored" in GDB1, GDB1 simply "points" to a memory location where the matrix is located ;)
Thanks!
Oh, yeah, since I have learned ASM, I realize that GDB1 is only a pointer. I said so for clarification purposes.
EDIT:
I can't seem to get this to work. Here is exactly what I did.
I entered the map I wanted in TokensIDE like this:
The I obviously used a much larger map. This is hexadecimal, so each two numbers stands for one hexadecimal nibble, if I am correct.
.Map
[404040404040404040404040404040404040404040404040]
[404040404040404040404040404040404040404040404040]
[404040404040404040404040404040404040404040404040]
[404040404040404040404040404040404040404040404040]
[404040404040404040404040404040404040404040404040]
[404040404040404040404040404040404040404040404040]
[404040404040404040404040404040404040404040404040]
[404040404040404040404040404040404040404040404040]
Next, using TokensIDE, it tokenized this as an appvar.
I sent the appvar to my calculator, and added this code to my program.
GetCalc("vmaps")->M
This is my tilemap routine: Before I entered the maps into the actual program and pointed to them using GDB1, it actually worked. In this code I replaced GDB1 with M.
For(A,0,11)
For(B,0,7)
If {V+B*72+A+H+M}->theta
Pt-Off(A*8,B*8,theta+Pic2-16)
End
End
End
This however, only gives me a bunch of trash on the screen.
Quote from: Switchblade on April 06, 2017, 09:55:12 PM
The I obviously used a much larger map. This is hexadecimal, so each two numbers stands for one hexadecimal nibble, if I am correct.
Two symbols in hexadecimal = one byte.
Quote
Next, using TokensIDE, it tokenized this as an appvar.
Tokenizing as an appvar will simply get you the string ".Map \n [40..." into your appvar instead of the actual *value* "[40..." stands for.
Just try compiling and running this axe program:
.A
[YOUR MATRIX HERE]->Str1
72 * 32 -> S
Copy(Str1,GetCalc("appvVMAPS",S),S)
ALso, i have no idea what Pic2 is in your render code. Could you explain?
Pic2 is the pointer for the sprites.
EDIT:
:D :w00t: :ninja: :love: It works! You are awesome!
How can I keep the appvars in archive without unarchiving and archiving them each time?
Axe can read appvars in archive without you unarchiving them. IIRC, you do: GetCalc("appvMYVAR",Y1) where Y1 is the function token. Then, {Y1} will point to then point to the first byte of the file, {Y1+1} the second, and so on. Remember that you cant write to an archived file, only read.
Ok, I will try that
I know its been a long time since my last question, and I think I know how to do this already, but I am just double checking. How do I copy a set amount of bytes from an appvar into L1 in Axe. I know what L1 is, don't worry ;)
*insert super long L1 explanation*
I thing yo uhave to loop through the memory area and copy the content piece by piece, unless there's a method to copy a large memory part which I know nothing about.
Buuut I haven't really "used" axe on a high lever in a long time, so <ou probably shouldn't listen to me anyways...
Copy(From,To,Size)
ok, now it's official, don't listen to anything I say >.<
/me hides in shame