Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Raylin on June 14, 2010, 10:37:35 am
-
Okay.
This has been alluded to before in another topic, but I need to understand.
How exactly would one get external data from another program?
-
I'm pretty sure you need to use the GetCalc( function. :)
-
Then, use the {PTR+OFFSET} to get the data?
How do you type that data out in the level file?
-
Well, the way I do it is to make the level data that is stored in your source code stored in a separate AppVar, then load the pointer into your program and display that one instead of the level stored in the source code.
-
Wait. Wait. Wait.
Are you implying that Axe can use SMC? :D :D
Explain.
-
A) Axe can use SMC
B) No, that is not what I'm talking about.
Normally for levels, you would have the data embedded in the source code, like a tilemap, right? Well, just embed a tilemap in an appvar and open the appvar in your program. Point your tilemapper to the appvar instead of the original tilemap. For instance, if a tilemap is stored internally in GDB1, and you open an appvar containing a tilemap and point to it with {P}, then tell your tilemapper to draw {P} instead of {GDB1}.
-
WOW! I didn't know you can do that! Thanks!
-
Sure.
-
I still have one more question though...
How does the data in the appvar look? How is it accessed? Could I store things like text and such inside?
I ask because I was thinking of making a large RPG and I need to store chapters of the game on one calc. They all won't fit in RAM.
-
Well, it is accessed with GetCalc(. Read up some documentation about that. You can write textual data using the program editor in TIOS, and convert it to an AppVar with CalcSys or one of many other utilities. You can write hex data or maps using CalcSys or Axe.
-
An AppVar looks just like a program only it's meant for data storage rather than to be executed. In Axe you're mainly looking at numbers, so it's easiest to put numbers in the AppVar. (imho) :)
Good luck. :D
-
This is actually a pretty good topic for the guide, I should include this.
-
I assume the appvar will most likely look like garbage if you convert it to program (for example with Cooliojazz shell or using Celtic III) then unlock it, so you won't be able to edit it like BASIC. You will need to make some sort of map editor (something I failed at, prbly due to all the scrolling and stuff) to update your levels.
-
If the AppVar used data in the form of BASIC tokens, editing using the BASIC program editor could be possible...
But then, it'd be somewhat awkward editing maps using a program editor.
-
I assume the appvar will most likely look like garbage if you convert it to program (for example with Cooliojazz shell or using Celtic III) then unlock it, so you won't be able to edit it like BASIC. You will need to make some sort of map editor (something I failed at, prbly due to all the scrolling and stuff) to update your levels.
Well, textual AppVars could be opened with the TIOS program editor just fine. Maps, on the other hand, wouldn't open too well.
-
By textual do you mean text data shows the actual ASCII characters?
-
Yes. I mean, an appvar that contains the ASCII representation of a string.
-
aaah good.
-
How do you change a program into an appvar through CalcSys?
-
Go to the VAT entry and change the ID.
I think it's documented in the zip file.
-
I don't remember. I just used that shell thing Cooliojazz posted in "Projects: Post and critique" a few days ago. Be careful, though, it's a bit buggy if you do something wrong, but it lets you change programs into appvars and unlock them. I think they need to be at least 5 char names, though
Otherwise there is Celtic III' by Iambian, but I do not know how.
-
If I use GetCalc(Str1), does that make an appvar of unknown length? Can I just keep dumping stuff into it or do I need to declare the size? Also, when I do that, do I need to specify the size IN BYTES?
-
I believe getcalc without size only tries to find the appvar. Returning a 0 if it doesn't exist.
Could be wrong tho.
-
Go to the VAT entry and change the ID.
I think it's documented in the zip file.
I looked in there. No documentation exists of this feature. Explain please?
-
I believe getcalc without size only tries to find the appvar. Returning a 0 if it doesn't exist.
Could be wrong tho.
Yeah, that's it.
Go to the VAT entry and change the ID.
I think it's documented in the zip file.
I looked in there. No documentation exists of this feature. Explain please?
Don't know exactly how to do it with CalcSys, but I believe there's one byte for each VAT entry (I think it's the first one counting backwards, called T) that designates what type of variable it is. Changing just that one byte will change whether the data is a program or an AppVar.
-
Do you know the address of that byte? And the numbers that you're allowed to change it to?
-
Tried it out on WabbitEmu. I changed the AppVar AxeData into a prgm just for the fun of it :D.
1. Go into CalcSys (duh).
2. Select 6. More.
3. Select 1. VAT.
4. Select 1. Prog/List VAT (which lists all the data for programs, AppVars, and lists).
5. Find AxeData. If it's not there, select 6. Next until you do find it.
6. Select it (by pressing the corresponding number key).
7. CalcSys will show you a screen full of information about the AppVar. Press ALPHA+[V] to edit its VAT entry.
8. Conveniently, the byte at T for AxeData is already pointed to for you. Just press ENTER to edit the byte and change it to 05 (ProgObj).
9. Press CLEAR twice to exit the app. AxeData should now be visible in the program menu (don't edit it).
10. Remember to undo all of it when you're done, or just delete the program AxeData.
Changing a program into an AppVar is the same, except you want to change the byte from 05 (ProgObj) to 15 (AppVarObj).
-
Do you know the address of that byte? And the numbers that you're allowed to change it to?
If you search through the Program/List VAT in Calcsys and select your program, you can press Alpha+V to view the VAT data in the hex editor. The byte you see then should either be a 5 or a 6 (for unlocked or locked). Change that value to 15h to change it to an appvar.
-
Do you know the address of that byte? And the numbers that you're allowed to change it to?
To quote from the ti83plus.inc (http://education.ti.com/downloads/files/computer_software/sdk_83p/ti83plus.inc) include file:
;======================================================================
; Data Type Equates
;======================================================================
;
RealObj EQU 0
ListObj EQU 1
MatObj EQU 2
EquObj EQU 3
StrngObj EQU 4
ProgObj EQU 5
ProtProgObj EQU 6
PictObj EQU 7
GDBObj EQU 8
UnknownObj EQU 9
UnknownEquObj EQU 0Ah
NewEquObj EQU 0Bh
CplxObj EQU 0Ch
CListObj EQU 0Dh
UndefObj EQU 0Eh
WindowObj EQU 0Fh
ZStoObj EQU 10h
TblRngObj EQU 11h
LCDObj EQU 12h
BackupObj EQU 13h
AppObj EQU 14h ;application, only used in menus/link
AppVarObj EQU 15h ;application variable
TempProgObj EQU 16h ;program, home deletes when finished
GroupObj EQU 17h ;group.
You can change the value to any of these hex numbers, except that most of them will probably mess up your calculator since the data takes different formats. Programs and AppVars can be exchanged fine since they have such similar data formats.