Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 May, 2013, 00:15:40 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: Help: Screenshotting program ends up screensh*tting -  (Read 1604 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« on: 21 May, 2010, 08:11:51 »
0

Ok so that french guy was asking how to make a program to store pics into programs, something that is impossible so far, but I decided to make an appvar version for now. However, I have problems. When I recall the pic, it's kinda glitchy. Some stuff shows fine, but other lines are garbage. I also got a crash once

Here's the code of my programs:


1
2
3
4
5
6
7
.SCRNSHOT
StoreGDB
"vPIC"->Str1
GetCalc(Str1)
GetCalc(Str1,768)
conj(L6,Str1,768)
DispGraph


1
2
3
4
5
6
7
.SCRNVIEW
"vPIC"->Str1
GetCalc(Str1)->M
If M
conj(Str1,L6,768)
DispGraph
End

Note: those two progs are launched from a TI-BASIC program so the graph screen is displayed prior launching them.

If anyone tries to debug this, please do not run on calc, or at least back up first, because my TI-Nspire froze once.

For french people, here's the original request: http://www.omnimaga.org/index.php?topic=2284.msg36767;topicseen#new
« Last Edit: 21 May, 2010, 08:13:02 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Online Online

Gender: Male
Last Login: Yesterday at 23:57:34
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5642


Total Post Ratings: +589

View Profile
« Reply #1 on: 21 May, 2010, 09:17:36 »
0

Ok in the first program, remove the first getcalc, add a '->M' to the end of the second getCalc statement and change the Str1 on the line after into an M

should work Smiley I'm on my itouch so sorry if I messed up
« Last Edit: 21 May, 2010, 09:18:33 by Builderboy » Logged

Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 18 May, 2013, 00:55:01
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Total Post Ratings: +1019

View Profile
« Reply #2 on: 21 May, 2010, 09:35:59 »
0

Yeah, Str1 is just a pointer to the name of the "vPIC" string it isn't the actual data.  You need to assign the getcalc result to a variable pointer (like M in builderboy's suggestion) becasue the appvars cannot be assigned static pointers like StrXX and PicXX since they move around a lot in ram and aren't in the same place every time you execute.
« Last Edit: 21 May, 2010, 09:37:11 by Quigibo » Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« Reply #3 on: 21 May, 2010, 13:30:31 »
0

Ooh wow I didn't knew variables were actually pointers. I thought they could only be like one byte lenght each. I didn't knew you could use -> at the end of the GetCalc(PTR,BYTES) command.

It still doesn't work, though. Now I changed what Builderboy told me to change and I got

1
2
3
4
5
6
7
.SCRNSHOT
StoreGDB
"vPIC"->Str1
GetCalc(Str1)
GetCalc(Str1,768)->M
conj(L6,M,768)
DispGraph
And it's even worse it seems, cuz it no longer actually manages to store even a single byte of the screen data. Undecided
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #4 on: 21 May, 2010, 13:45:18 »
0

I don't think you need the first "GetCalc" (did someone already say that?) and the "DispGraph" at the end seems superfluous, but it should work. Let me try...
Also, scrnview should have that last Str1 (the one in the conj( line) be M also.
As an afterthought, though I doubt this is your problem, just be aware that if there isn't enough free ram when you try to create vPIC, nothing will actually be created (since you are then proceeding to try to write to ROM, nothing bad will happen.)
Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« Reply #5 on: 22 May, 2010, 00:55:36 »
0

didn't I need to use GetCalc(Str1) to point to the appvar name? Else IIRC it couldn't find the appvar

I definitively think someone needs to write a tutorial on how to use Getcalc. It is getting way too complicated and confusing
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #6 on: 22 May, 2010, 04:16:54 »
0

no, calling GetCalc(Str1,768) creates vPIC it if it doesn't exist, deletes it and recreates it if it does, and then proceeds to return the pointer to the 768 bytes of data.
And yeah, variable management can be difficult. The "correct" way to create an appvar is a bit unwieldy, as this code that loads the value in an appvar demonstrates:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"vSCORE"->Str1
GetCalc(Str1)->X
.If it's non-zero, we're good, otherwise it's archived or non existent.
!If
    UnArchive Str1
    .If 0, it failed. Try to create the appvar
    !If
        GetCalc(Str1,2)
        .If it's 0, not enough RAM. Err and give up.
        !If
            "Not enough RAM"->Str2
            Disp Str2,i
            Return
        End
    End
    GetCalc(Str1)->X
    .This next If should never be reached
    !If
        "Serious Error"->Str3
        Disp Str3,i
        Return
    End
End
.X should now contain the pointer to the data. Phew!
Even w/o comments and indents, it still looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"vSCORE"->Str1
GetCalc(Str1)->X
!If
UnArchive Str1
!If
GetCalc(Str1,2)
!If
"Not enough RAM"->Str2
Disp Str2,i
Return
End
End
GetCalc(Str1)->X
!If
"Serious Error"->Str3
Disp Str3,i
Return
End
End
Oh, if an If has on condition following it, it's the condition on the previous line.
« Last Edit: 22 May, 2010, 04:17:43 by calcdude84se » Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« Reply #7 on: 22 May, 2010, 04:24:03 »
0

Is !If with nothing after the equivalent of If not(Ans) in BASIC?
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #8 on: 22 May, 2010, 04:25:58 »
0

pretty much. and "If" is about the equivalent of "If Ans"
Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« Reply #9 on: 22 May, 2010, 04:31:55 »
0

ooh that's good to know. I did not even know Axe supported some sort of Ans style feature (where the last value is stored after doing something). I guess that's why stuff like 1->A->B->C->D can be done

EDIT: Well I give up, I tried what you all told me to do and to no avail.

I think making a program to store pictures to appvars in Axe is impossible. It just starts reading the appvar content from the wrong location and that stuff is too much for me anyway.

If anyone wants to attempt at writing such program, feel free to do so. Kindermoumoute would appreciate very well.

EDIT: Example of what happens wrong. Both myself and him tried and we got similar results:

The image being stored to the appvar


The image being recalled


In my case it was more off, though.
« Last Edit: 22 May, 2010, 07:13:40 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 18 May, 2013, 00:55:01
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Total Post Ratings: +1019

View Profile
« Reply #10 on: 22 May, 2010, 07:23:13 »
0

I'm using minimal error testing, basically if there is a problem, the program will just exit.

Copy the drawing buffer to the appvar

1
2
3
4
"vPIC"->Str1
Return!If GetCalc(Str1,768)->A
conj(L6,A,768)

Or if you want the current LCD instead

1
2
3
4
5
"vPIC"->Str1
StoreGDB
Return!If GetCalc(Str1,768)->A
conj(L6,A,768)

Copy the appvar to the buffer and then to the screen

1
2
3
4
5
6
"vPIC"->Str1
Unarchive Str1
Return!If GetCalc(Str1)->A
conj(A,L6,768)
DispGraph

Or simply display it on the LCD directly

1
2
3
4
5
"vPIC"->Str1
Unarchive Str1
Return!If GetCalc(Str1)->A
A->DispGraph
Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« Reply #11 on: 22 May, 2010, 07:31:42 »
0


1
2
3
4
5
"vPIC"->Str1
StoreGDB
Return!If GetCalc(Str1,768)->A
conj(L6,A,768)
That gives an ERR:BAD SYMBOL error at 76%
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 18 May, 2013, 00:55:01
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Total Post Ratings: +1019

View Profile
« Reply #12 on: 22 May, 2010, 07:38:17 »
0

You just found a new bug x.x  I'll fix it later, just do this for now, it does the same thing and seems to work:

Replace:

1
Return!If GetCalc(Str1,768)->A

With:

1
2
GetCalc(Str1,768)->A
Return!If
Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:36:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50202


Total Post Ratings: +2611

View Profile WWW
« Reply #13 on: 22 May, 2010, 07:41:42 »
0

Ok that works, but now Quigibo I think I found a second bug, and I fear this might be the source of all my problems. Hold on I'll try my original program on another calc model...
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
kindermoumoute
LV8 Addict (Next: 1000)
********
Offline Offline

Last Login: 17 May, 2013, 21:33:10
Date Registered: 15 May, 2010, 17:53:56
Posts: 836


Total Post Ratings: +51

View Profile
« Reply #14 on: 22 May, 2010, 09:51:22 »
0

This time there are two results, the first picture that displays whatever and another that displays a portion of the picture Undecided

The second picture uses "A => dispgraph" and third I do not know Undecided


* PIC1 ORIGINAL.BMP (72.05 KB, 192x128 - viewed 152 times.)

* RECALLPIC1DIRDG.BMP (72.05 KB, 192x128 - viewed 154 times.)

* RECALLPIC1CONJ.BMP (72.05 KB, 192x128 - viewed 155 times.)
Logged

Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.269 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.