Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: kindermoumoute on September 12, 2010, 04:49:56 am

Title: Save screen on a variable pic calculator
Post by: kindermoumoute on September 12, 2010, 04:49:56 am
Here I ask the right and left and nobody seems to know if possible, i want :
Copy the screen (StoreGDB) and then save it to a variable Pic1-Pic9 reusable in TI-Basic.

no idea?
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 12, 2010, 05:03:02 am
Sry i found. My post is useless.
Title: Re: Save screen on a variable pic calculator
Post by: DJ Omnimaga on September 12, 2010, 05:04:59 am
What solution did you find to the problem? Could you post the source code?
Title: Re: Save screen on a variable pic calculator
Post by: meishe91 on September 12, 2010, 05:10:01 am
I think it has to do with like taking the the buffer and using GetCalc( to store it to Pic#. I don't remember though, someone else asked not to long ago though I think.
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 12, 2010, 05:36:39 am
that's same function than other Variable, just need "Pic1"=>Str1 and next u manipulate. it's just i write Pic1 in TI-Editor and calc understand P-i-c-1 :/
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 12, 2010, 06:09:27 am
As i open this topic for help, i ask a new stuff :
when i do
"Pic1"=>Str1
"Pic2Pic3Pic4"
for use Pic2 or Pic3..etc i do Str1+4 and fail, next i do Pic1+1 and crash.. no idea? =)
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 12, 2010, 10:05:52 am
Oh, it's because when you "store" to a string, it actually adds a zero byte to the end of it, so

"Pic1"→Str1

would actually become

"Pic1"
[00]


because in assembly, strings need to end in a zero. So to make your code work, try

"Pic1"→Str1
"Pic2"
[00]
"Pic3"
[00]
"Pic4"
[00]


then access it with Str1.
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 12, 2010, 10:45:34 am
Ok, then i type Str1+1 or Str1+4?
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 12, 2010, 10:46:42 am
Yeah, for GetCalc(.

Actually, you might want to check first with everything archived. I haven't tried it yet.
Title: Re: Save screen on a variable pic calculator
Post by: calcdude84se on September 12, 2010, 10:48:10 am
You use Str1, Str1+2, Str1+4, and Str1+6, because each [00] is also a byte.
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 12, 2010, 10:51:45 am
Ahh, whoops, forgot about that x.x

Good thing you got here, calcdude. Yeah, count in 2s instead.
Title: Re: Save screen on a variable pic calculator
Post by: calcdude84se on September 12, 2010, 10:57:26 am
Actually, wait. I think it actually goes up 3 at a time...
Str1, Pic1, etc. are actually two bytes...
Edit: Actually, don't pad with [00]'s at all. Use "Pic1Pic2Pic3Pic4"->Str1 and increment two at a time.
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 12, 2010, 10:58:36 am
What? Oh crap. Right, three bytes.

As I said, I never checked :P
Title: Re: Save screen on a variable pic calculator
Post by: calcdude84se on September 12, 2010, 10:59:35 am
^ And my above note. The padding should be unnecessary. ;D
I might still be wrong though...
* calcdude checks to make sure
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 12, 2010, 11:01:16 am
Actually, for calcdude's edit, that still doesn't work. There's that extra [00], remember?

Try

[]→Str1
"Pic1Pic2Pic3Pic4"


EDIT: Oh, wait, never mind. That works.

EDIT2: NO! Wait! I think you do need padding: http://future_history.freehostia.com/Files/Resources/ASM/ASMin28Days/lesson/day19.html (http://future_history.freehostia.com/Files/Resources/ASM/ASMin28Days/lesson/day19.html) (go down to Matrices, Pictures, Strings).
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 12, 2010, 11:10:04 am
Yes first time my program work ^^ i've a version alpha 0.9.0 almost stable!
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 12, 2010, 11:10:54 am
Great! Which one did you use, though?
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 12, 2010, 11:17:53 am
i'll update my post, that's megr2.0 prgm.
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 12, 2010, 11:20:11 am
Oh, but I meant which code you used to fix that Pic > Str thing (just for reference).
Title: Re: Save screen on a variable pic calculator
Post by: calcdude84se on September 12, 2010, 11:21:57 am
Okay... looking at the developer's guide (by TI), it seems that each of "Pic1" etc. are three bytes and need to be followed by a 0.
So it should look like
Code: [Select]
"Pic1->Str1
"Pic2
[00]
"Pic3
[00]
"Pic4
[00]
And they're accessed by Str1, Str1+4, Str1+8, and Str1+12.
There we go; I'm almost certain I'm correct this time :)
Edit: Screenshot o'proof:
(http://i55.tinypic.com/14tut5.jpg)
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 12, 2010, 11:44:21 am
Oh, wow, ignore the earlier posts in that case. I wonder how Kindermoumoute managed to make it work...
Title: Re: Save screen on a variable pic calculator
Post by: calcdude84se on September 12, 2010, 11:46:58 am
I don't know... maybe he used only Str1 and didn't try the other ones... idk.
Well, I'm glad we finally figured this out. Good luck Kindermoumoute!
Title: Re: Save screen on a variable pic calculator
Post by: Quigibo on September 12, 2010, 01:57:08 pm
If you have a variable S which is the S-th pic, you can save pictures like this instead:

Code: [Select]
"Pic1"->Str1   .Only need one string name
S->{Str1+2}    .Changes to Pic2, Pic3, etc.
GetCalc(Str1)  .Use the string
Title: Re: Save screen on a variable pic calculator
Post by: calcdude84se on September 12, 2010, 02:01:59 pm
Wait, isn't it that storing S to {Str1+2} corresponds to the S+1-th pic?
In my above screenie, you'll see they are from $00-$03, and I used pics 1-4 ;D
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 12, 2010, 02:28:11 pm
Look post of my program megr2.0 drawing (http://ourl.ca/6291/116825;topicseen#new), i use this command.
(http://www.omnimaga.org/index.php?action=dlattach;topic=3694.0;attach=3211;image)
Title: Re: Save screen on a variable pic calculator
Post by: DJ Omnimaga on September 12, 2010, 02:31:20 pm
Wow, just looked at the code. I really need to get back into Axe. I didn't even know how to store stuff to OS variables x.x
Title: Re: Save screen on a variable pic calculator
Post by: _player1537 on September 12, 2010, 02:48:54 pm
Wow, just looked at the code. I really need to get back into Axe. I didn't even know how to store stuff to OS variables x.x
Don't worry, I don't either :P
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 13, 2010, 04:36:34 pm
hm ok, i understand what u say, i write Pic+2 then he can work because my prgm use always Pic+2, but pics in calc did not appear. I had more memory corrupt. So I corrected in Pic+4 and big reset of the death (I won 10ko for exactly the same programs in memory :o ) and this works!
Title: Re: Save screen on a variable pic calculator
Post by: DJ Omnimaga on September 13, 2010, 05:02:56 pm
I hope you did not lose any precious data :O
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 13, 2010, 07:22:32 pm
If you have a variable S which is the S-th pic, you can save pictures like this instead:

Code: [Select]
"Pic1"->Str1   .Only need one string name
S->{Str1+2}    .Changes to Pic2, Pic3, etc.
GetCalc(Str1)  .Use the string

Oh, yeah! I'm still not used to SMC :)

hm ok, i understand what u say, i write Pic+2 then he can work because my prgm use always Pic+2, but pics in calc did not appear. I had more memory corrupt. So I corrected in Pic+4 and big reset of the death (I won 10ko for exactly the same programs in memory :o ) and this works!

Are you talking about Quigibo's post? It's {Str1+2}, not Pic1. And I hope you didn't lose anything important :-\
Title: Re: Save screen on a variable pic calculator
Post by: ztrumpet on September 13, 2010, 07:51:08 pm
I hope you did not lose any precious data :O
me too. :)

Wow, just looked at the code. I really need to get back into Axe. I didn't even know how to store stuff to OS variables x.x
Don't worry, I don't either :P
me too. :P
Title: Re: Save screen on a variable pic calculator
Post by: Deep Toaster on September 13, 2010, 08:54:17 pm
I hope you did not lose any precious data :O
me too. :)

Darn, that just made me lose.
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 26, 2010, 09:04:57 am
I see that there are still some bugs in my method to save my pictures. When I save, I have a chance in two that he register in the picture but they are not (not shown) in the calculator.
As shown in the screen below, I record in picture 1.2, 8 and 9 during my drawings. But the result is going to tell me that only Pic1 and Pic2 (in the menu from memory) when the variables are well and stored in the list of images (and I can remember). And one can also notice that when I recall the image 1 or 2, there are 5 lines shift up images.

Screen :
(http://img839.imageshack.us/img839/889/megrscreenwithbug.gif)

Source (Only regards the manipulation of pictures) :
Code: [Select]
:"Pic1"→Str1
:"Pic2"
:[00]
:"Pic3"
:[00]
:"Pic4"
:[00]
:"Pic5"
:[00]
:"Pic6"
:[00]
:"Pic7"
:[00]
:"Pic8"
:[00]
:"Pic9"
:[00]
[...]
:Repeat I≠1
:sub(I)
:End
:UnArchive Str1+I
:If GetCalc(Str1+I)
:GetCalc(Str1+I,768)→R
:R→DispGraph
:StoreGDB
:Else
:Output(0,0,"ERROR
:Repeat getKey(9)
:End
:1→I
:Return
:End
:Archive Str1+I
:1→I
[...]
:sub(I
:If I≠1
:Pxl-Off(X,Y)
:DispGraph
:StoreGDB
:GetCalc(Str1+I,768)→C
:conj(L<sub>6</sub>,C,768)
:Archive Str1+I
:1→I
:End
[...]
:Lbl I
:If getKey(34)
:0→I
:End
:If getKey(26)
:4→I
:End
:If getKey(18)
:8→I
:End
:If getKey(35)
:12→I
:End
:If getKey(27)
:16→I
:End
:If getKey(19)
:20→I
:End
:If getKey(36)
:24→I
:End
:If getKey(28)
:28→I
:End
:If getKey(20)
:32→I
:End
:Return

Where is problem?


PS : Here it is taken with a TI-84 + SE Emulator, but on my TI-83 + we find the same problem.
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 27, 2010, 02:28:25 pm
help me please :/
Title: Re: Save screen on a variable pic calculator
Post by: calcdude84se on September 27, 2010, 04:32:45 pm
Would it be possible for you to post the full source code as a .8xp file so we can mess around with it ourselves?
At any rate, I'll try to help when I have more time. :)
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 27, 2010, 04:41:12 pm
Why not, but Its not going to help you :/
Spoiler For Code:
:.MEGR2.0
:"Pic1"→Str1
:"Pic2"
:[00]
:"Pic3"
:[00]
:"Pic4"
:[00]
:"Pic5"
:[00]
:"Pic6"
:[00]
:"Pic7"
:[00]
:"Pic8"
:[00]
:"Pic9"
:[00]
:":PIC →Str14
:"MEGR2.0 DRAW :→Str15
:"1:NEW→Str16
:"2:LOOK→Str17
:"3:CHANGE→Str18
:"4:LOOK GRAYSCALE→Str19
:"CLR:QUIT→Str20
:0→Q→F→E→H→W→R→G
:1→I→T
:31→X+16→Y
:ClrHome
:ClrDraw
:ClrDraw<sup>r</sup>
:Repeat getKey(15)
:Text(0,0,Str15
:Text(0,14,Str16
:Text(0,21,Str17
:Text(0,28,Str18
:Text(0,35,Str19
:Text(0,42,Str20
:If getKey(34) or getKey(26) or getKey(18) or getKey(35)
:If getKey(34)
:sub(GO)
:sub(A
:End
:If getKey(26)
:sub(GO)
:2→G
:sub(B
:End
:If getKey(18)
:sub(GO)
:1→G→Q
:sub(B
:End
:If getKey(35)
:sub(B
:End
:ClrDraw<sup>r</sup>
:ClrDraw
:ClrHome
:End
:End
:Return
:
:Lbl B
:ClrHome
:Repeat E=9
:E+1→E
:F+6→F
:Text(0,F,E►Dec,Str14,E►Dec
:End
:0→E→F
:Repeat I≠1
:sub(I)
:End
:UnArchive Str1+I
:If GetCalc(Str1+I)
:GetCalc(Str1+I,768)→R
:R→DispGraph
:
:StoreGDB
:!If G
:StorePic
:Archive Str1+I
:1→I→G
:Repeat getKey(9)
:End
:Goto B
:End
:Else
:Output(0,0,"ERROR
:Repeat getKey(9)
:End
:1→I
:Return
:End
:Archive Str1+I
:1→I
:!If Q=1
:Repeat getKey(9)
:If G=2
:DispGraph
:Else
:DispGraph<sup>r</sup>
:End
:End
:0→G→Q
:Return
:Else
:ClrHome
:0→G→Q
:End
:
:Lbl A
:Repeat getKey(48)
:Pxl-On(X,Y)
:DispGraph
:sub(I
:If I≠1
:Pxl-Off(X,Y)
:DispGraph
:StoreGDB
:GetCalc(Str1+I,768)→A
:conj(L<sub>6</sub>,A,768)
:Archive Str1+I
:1→I
:End
:If getKey(53) or getKey(52)
:If getKey(53)
:1→R
:End
:If getKey(52)
:0→R
:End
:While getKey(53)
:sub(R
:End
:While getKey(52)
:sub(R
:End
:If R
:ref(X,Y,W,H)
:End
:!If R
:rref(X,Y,W,H)
:End
:0→W→H
:End
:!If getKey(54)
:Pxl-Off(X,Y)
:End
:If getKey(15)
:ClrHome
:ClrDraw
:ClrDraw<sup>r</sup>
:End
:sub(T
:If getKey(1) and (Y≠63
:Y+1→Y
:End
:If getKey(2) and (X≠0
:X-1→X
:End
:If getKey(3) and (X≠95
:X+1→X
:End
:If getKey(4) and (Y≠0
:Y-1→Y
:End
:End
:Goto GO
:
:Lbl R
:ClrDraw<sup>r</sup>
:StorePic
:If R
:ref(X,Y,W,H)<sup>r</sup>
:End
:!If R
:rref(X,Y,W,H)<sup>r</sup>
:End
:DispGraph<sup>r</sup>
:sub(T
:If getKey(1) and ((H+Y)≠63
:H+1→H
:End
:If getKey(2) and (W≠0
:W-1→W
:End
:If getKey(3) and ((X+W)≠95
:W+1→W
:End
:If getKey(4) and (H≠0
:H-1→H
:End
:Return
:
:Lbl T
:If getKey(47)
:1→T
:End
:If getKey(39)
:50→T
:End
:If getKey(31)
:100→T
:End
:If getKey(23)
:200→T
:End
:Pause T
:Return
:
:Lbl I
:If getKey(34)
:0→I
:End
:If getKey(26)
:4→I
:End
:If getKey(18)
:8→I
:End
:If getKey(35)
:12→I
:End
:If getKey(27)
:16→I
:End
:If getKey(19)
:20→I
:End
:If getKey(36)
:24→I
:End
:If getKey(28)
:28→I
:End
:If getKey(20)
:32→I
:End
:
:Lbl GO
:Repeat getKey(0)
:End
Title: Re: Save screen on a variable pic calculator
Post by: shmibs on September 27, 2010, 07:44:12 pm
iv'e had the same 5 line shift thing happen before when dealing with external vars. try a RAM clear and then remake the pics to see if it clears things up
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 28, 2010, 11:30:15 am
I clear ram everyday.
Title: Re: Save screen on a variable pic calculator
Post by: kindermoumoute on September 29, 2010, 01:45:04 pm
No idea?
Title: Re: Save screen on a variable pic calculator
Post by: DJ Omnimaga on September 29, 2010, 01:57:47 pm
Mhmm, I wonder if this might not be something similar to my problem with appvars a long while ago.

In fact it was related to your program, but I was trying to write the routine:

http://ourl.ca/4886

I am unsure if this would apply for pictures, though. You may have to PM Quigibo directly for help, as he might no longer check the help topics.
Title: Re: Save screen on a variable pic calculator
Post by: Quigibo on September 29, 2010, 04:55:10 pm
I can't seem to find anywhere in that code where it actually loads a picture from RAM.  There are 2 places where it creates a new picture though, so maybe that's the error?  Remember, one argument means it loads the variable and 2 arguments means it creates a new variable.