# Omnimaga

## Calculator Community => TI Calculators => Axe => Topic started by: parserp on October 21, 2011, 03:07:22 pm

Title: Storing Pics
Post by: parserp on October 21, 2011, 03:07:22 pm
Ok, so here's my question:
If I have something displayed on the graph screen in axe, and then I want to be able to press a key and store it as a REAL picture, not an appvar, how would I go about doing that?

Second question:
How would I store the pic into an appvar and then recall it in a different program?

(ok so 2 questions :P)
Title: Re: Storing Pics
Post by: Yeong on October 21, 2011, 03:09:30 pm
2nd question:

To Store Pic in appvar:
GetCalc("appvBLAH",768)→A  //appvBLAH created and stored into pointer A
[Pic1]→B //Pic1 in OS Stored into pointer B
Copy(B,A,768) //Copies Pic1 into appvBLAH

to call it.
Getcalc("appvBLAH")→A  //Call appvBLAH from OS and stores it into pointer A
To display that Picture after you call it:
Copy(A,L6,768
Title: Re: Storing Pics
Post by: Hayleia on October 21, 2011, 03:14:48 pm
to call it.
Getcalc("appvBLAH")→A  //Call appvBLAH from OS and stores it into pointer A
To display that Picture after you call it:
Copy(A,L6,768
And to call it from archive instead of having the appvar unarchived, you do
Getcalc("appvBLAH",Y0)
Copy(A,Y0,768

And if it doesn't work, replace "Copy(A,Y0,768" by
For(r1,0,767
{Y0+r1}→L6+r1
End
Title: Re: Storing Pics
Post by: parserp on October 21, 2011, 03:15:52 pm
2nd question:

To Store Pic in appvar:
GetCalc("appvBLAH",768)→A  //appvBLAH created and stored into pointer A
[Pic1]→B //Pic1 in OS Stored into pointer B
Copy(B,A,768) //Copies Pic1 into appvBLAH

to call it.
Getcalc("appvBLAH")→A  //Call appvBLAH from OS and stores it into pointer A
To display that Picture after you call it:
Copy(A,L6,768
Ooh I get it now XD
now for the 1st question...
Title: Re: Storing Pics
Post by: C0deH4cker on October 21, 2011, 04:05:58 pm
to call it.
Getcalc("appvBLAH")→A  //Call appvBLAH from OS and stores it into pointer A
To display that Picture after you call it:
Copy(A,L6,768
And to call it from archive instead of having the appvar unarchived, you do
Getcalc("appvBLAH",Y0)
Copy(A,Y0,768

And if it doesn't work, replace "Copy(A,Y0,768" by
For(r1,0,767
{Y0+r1}→L6+r1
End

That second part is wrong. It should be:

{Y0+r1}→{L6+r1}
Title: Re: Storing Pics
Post by: ztrumpet on October 21, 2011, 04:10:54 pm
This should give you a lot of insight into how to make the first question's answer work: http://eeems.omnimaga.org/Files/Resources/Tutorials/ASMin28Days/lesson/day19.html and http://eeems.omnimaga.org/Files/Resources/Tutorials/ASMin28Days/lesson/day24.html
If you don't understand some of the Asm stuff, just skip it. ;)
Title: Re: Storing Pics
Post by: C0deH4cker on October 21, 2011, 04:14:07 pm
Title: Re: Storing Pics
Post by: C0deH4cker on October 21, 2011, 04:16:29 pm
Nevermind. The end was cut off. I tried to edit my last post so its not double posting, but there is no modify or edit button. Theres only a little checkbox.
Title: Re: Storing Pics
Post by: parserp on October 21, 2011, 04:18:10 pm
If you don't understand some of the Asm stuff, just skip it. ;)
I don't understand any of it... ???
can anyone answer my first question?
Title: Re: Storing Pics
Post by: Yeong on October 21, 2011, 10:04:42 pm
you could do this:
Code: [Select]
`prgmSOMETHNG //TI-BASIC PROGRAMAsm(prgmAXEPROGRAMTHATDISPLAYSPICTUREINGRAPHSCREENStorePic 1`
Easy getaround. No assembly required XD
Title: Re: Storing Pics
Post by: jacobly on October 21, 2011, 10:11:54 pm
Just do this Copy(L₆,GetCalc("Pic1",756),756) :)
Title: Re: Storing Pics
Post by: parserp on October 21, 2011, 10:14:46 pm
ooh thanks it works now... ;D
EDIT: how would I input a name for the appvar?
It won't let me do
Code: [Select]
`:inputStr1`
Title: Re: Storing Pics
Post by: Yeong on October 21, 2011, 10:42:25 pm
I always wondered how to do that either XP
Title: Re: Storing Pics
Post by: parserp on October 21, 2011, 10:43:23 pm
I always wondered how to do that either XP
so in other words you can't?
Title: Re: Storing Pics
Post by: Yeong on October 21, 2011, 10:44:33 pm
I believe it's possible. maybe if you store "appv" to a string and the name into other string and concentrate it, it would work.
Title: Re: Storing Pics
Post by: parserp on October 21, 2011, 10:45:31 pm
I believe it's possible. maybe if you store "appv" to a string and the name into other string and concentrate it, it would work.
I think I get the idea, but could you put that in code please?

EDIT: new page!
Title: Re: Storing Pics
Post by: ztrumpet on October 21, 2011, 11:15:03 pm
If you don't understand some of the Asm stuff, just skip it. ;)
I don't understand any of it... ???
can anyone answer my first question?
Alright, I'll try my best to explain how to do it without writing it for you. ;)

First you have to create the variable.  This is done with GetCalc(PTR,SIZE).  SIZE will almost* always 756 bytes, as it's 63*12.  The pointer will point to some information like this:
7,96,Picture Number (Pic1 is 0, Pic2 is 1, ... Pic0 is 10),0
This is [0760##00] in hex.

GetCalc will return a pointer to the new file.  You then have to fill the file with data.  The 756 bytes are all the picture info.  You can just copy 756 bytes from the main buffer (L6) into it if you want.

This is the basic premise.  I'm not 100% sure this will work - I've never done this in Axe before, but I know I'm on the right track.  Good luck getting this to work - if it doesn't, let me know, and I'll try and figure out what I screwed up. :P

P.S.  You know how I kept saying "almost*"?  Well, that's because you can have different sized pictures, but they may cause unpredictable behavior. :P  Edit: After talking to Runer I found out that he recommends making it 768 bytes and then being able to copy the whole buffer.
Title: Re: Storing Pics
Post by: parserp on October 21, 2011, 11:25:53 pm
If you don't understand some of the Asm stuff, just skip it. ;)
I don't understand any of it... ???
can anyone answer my first question?
Alright, I'll try my best to explain how to do it without writing it for you. ;)

First you have to create the variable.  This is done with GetCalc(PTR,SIZE).  SIZE will almost* always 756 bytes, as it's 63*12.  The pointer will point to some information like this:
7,96,Picture Number (Pic1 is 0, Pic2 is 1, ... Pic0 is 10),0
This is [0760##00] in hex.

GetCalc will return a pointer to the new file.  You then have to fill the file with data.  The 756 bytes are all the picture info.  You can just copy 756 bytes from the main buffer (L6) into it if you want.

This is the basic premise.  I'm not 100% sure this will work - I've never done this in Axe before, but I know I'm on the right track.  Good luck getting this to work - if it doesn't, let me know, and I'll try and figure out what I screwed up. :P

P.S.  You know how I kept saying "almost*"?  Well, that's because you can have different sized pictures, but they may cause unpredictable behavior. :P  Edit: After talking to Runer I found out that he recommends making it 768 bytes and then being able to copy the whole buffer.
ooh I get it now... now all I need is to find out how to input strings...
Title: Re: Storing Pics
Post by: ztrumpet on October 21, 2011, 11:26:54 pm
now all I need is to find out how to input strings...

Here's how I do it: http://ourl.ca/4129/122465
Title: Re: Storing Pics
Post by: Yeong on October 21, 2011, 11:27:24 pm
appvars will be a better choice to store pics because you can store more than one in appvar! XD
Code: [Select]
`GetCalc("appvWHATEVER",768*number_of_pictures)->A[Pic1]->Str1[Pic2]->Str2 . . . etcCopy(Str1,A,768)Copy(Str2,A+768,768) . . . etc`
Title: Re: Storing Pics
Post by: parserp on October 26, 2011, 05:43:50 pm
Ok, so I have yet another question.  ;)
so I have a moving charector in a game, and I want to be able to press a key and have his coordinates stored in a REAL variable (as in the ones on the calc)
How would I do that?  ???
Title: Re: Storing Pics
Post by: Yeong on October 26, 2011, 05:45:40 pm
GetCalc("varA"->D       //Calls Variable A from OS
float{D}->A               //Store it into Axe var A
Repeat getKey(Whatever)
.....
End
A->float{D}               //After you're done messing with Axe var A, store it back into OS A.
Title: Re: Storing Pics
Post by: parserp on October 26, 2011, 06:05:22 pm
hmmm... I can't get that to work.
Here's the smidgin of code that doesn't work:
Code: [Select]
`:.players position is (X,Y):If getKey(53):GetCalc("varA")->D:GetCalc("carB")->E:X->A:Y->B:A->float{D}:B->float{E}:End`
Title: Re: Storing Pics
Post by: Yeong on October 26, 2011, 06:07:34 pm
what error does it gives you?
also, you must have something stored in OS var D and E I think.
Title: Re: Storing Pics
Post by: calc84maniac on October 26, 2011, 06:08:52 pm
GetCalc("varA")→D

Edit: I got double ninja'd O_o
Title: Re: Storing Pics
Post by: Yeong on October 26, 2011, 06:09:25 pm
I hope he really didn't typed "->" instead of →
D:
Title: Re: Storing Pics
Post by: parserp on October 26, 2011, 06:10:51 pm
It compiles perfectly well, but when I do that and exit the program, it doesn't change the values of the variables to what it should be.
EDIT: tried deleting vars first and it still didn't work.
Title: Re: Storing Pics
Post by: Yeong on October 26, 2011, 06:11:50 pm
do you happen to use number >9999 ?
Title: Re: Storing Pics
Post by: parserp on October 26, 2011, 06:12:59 pm
Nope. I had the player at position (1,1) and it didn't work.
Title: Re: Storing Pics
Post by: Quigibo on October 26, 2011, 07:27:55 pm
Are you using the latest Axe version?  Some older versions referenced floats incorrectly due to overcompensating for the size field.
Title: Re: Storing Pics
Post by: parserp on October 26, 2011, 10:55:42 pm
yupp, using 1.0.5b

EDIT: another new page!