Alternatively, join us on Discord.

TI 83 plus Axe Appvars

Started by Switchblade, April 06, 2017, 09:41:23 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Switchblade

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? :)

c4ooo

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 ;)

Switchblade

April 06, 2017, 09:55:12 pm #2 Last Edit: April 06, 2017, 10:05:44 pm by Switchblade
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.

c4ooo

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?

Switchblade

April 07, 2017, 01:49:13 am #4 Last Edit: April 07, 2017, 01:53:09 am by Switchblade
Pic2 is the pointer for the sprites.

EDIT:
:D  :w00t: :ninja: :love: It works! You are awesome!

c4ooo


Switchblade

How can I keep the appvars in archive without unarchiving and archiving them each time?

c4ooo

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.

Switchblade


Switchblade

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  ;)

p2

*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...
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

c4ooo


p2

ok, now it's official, don't listen to anything I say >.<
* p2 hides in shame
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Powered by EzPortal