You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

TI 83 plus Axe Appvars

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0
b/Calculator Development publicado por u/Switchblade April 06, 2017, 09:41:23 PM
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? :)
Inicia sesión o crea una cuenta para dejar un comentario
u/c4ooo April 06, 2017, 09:52:54 PM
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 ;)
u/Switchblade April 06, 2017, 09:55:12 PM
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.
Last Edit: April 06, 2017, 10:05:44 PM by Switchblade
u/c4ooo April 07, 2017, 12:14:34 AM
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?
u/Switchblade April 07, 2017, 01:49:13 AM
Pic2 is the pointer for the sprites.

EDIT:
:D  :w00t: :ninja: :love: It works! You are awesome!
Last Edit: April 07, 2017, 01:53:09 AM by Switchblade
u/c4ooo April 07, 2017, 01:53:11 AM
Quote from: Switchblade on April 07, 2017, 01:49:13 AM
Pic2 is the pointer for the sprites.
Makes sense :)
u/Switchblade April 08, 2017, 10:38:35 PM
How can I keep the appvars in archive without unarchiving and archiving them each time?
u/c4ooo April 08, 2017, 10:45:00 PM
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.
u/Switchblade April 08, 2017, 10:48:33 PM
Ok, I will try that
u/Switchblade May 08, 2017, 05:17:55 PM
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  ;)
u/p2 May 08, 2017, 08:42:25 PM
*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...
u/c4ooo May 08, 2017, 09:10:57 PM
Copy(From,To,Size)
u/p2 May 08, 2017, 09:25:42 PM
ok, now it's official, don't listen to anything I say >.<
* p2 hides in shame
Start a Discussion

b/Calculator Development

Showcase your newest TI, Casio, HP, Numworks or Sharp calculator projects here, discuss programming and share or browse user tutorials!

320
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal