Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: epic7 on October 28, 2011, 08:10:04 pm

Title: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:10:04 pm
Im trying to make a title screen. I don't really know how to make it work.

(the third picture also shows half of whats  on the previous page.

Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:11:22 pm
What's the pic? (both)
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:12:46 pm
Those are pics of the code
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:13:37 pm
no as in Pic0 and Pic9.

EDIt: does it compile?
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:14:54 pm
Pic9 is a graph image I storepic'd. Pic0 is an 8x8 of an arrow. It compiles
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:17:16 pm
hmmm...
my expirience with pics is: DON'T!
I always use appvars, easier to store, recall, and doesn't take up precious pic space.
whenever I use a OS pic, it puts the pixels wherever it wants.
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:17:48 pm
How do you use appvars?
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:18:24 pm
one sec...
I gotta get code...

ok got it...
just make a simple drawing program in which you draw the pic desired... (I can help with that too :)) and then do this:
Code: [Select]
:If getKey(42) //press store
:ClrHome //duh
:Disp "Saving...",i //imaginary i
:GetCalc("appvPIC",768)->A //appvar PIC created (768 bytes, for a picture) and stored in pointer A
:Copy(L6,A,768) //copies L6 (buffer) into appvar (pointer A)
:Archive "appvPIC" //this is optional, won't delete in ram clears
:End
and to recall it...
Code: [Select]
:ClrDraw
:GetCalc("appvPIC",Y0) //recalls pic from archive and stored in Y0
:For(r1,0,767) //loops through all bytes in pic
:{Y0+r1}->{L6+r1} //copies byte into L6 (buffer)
:End
:DispGraph
Optimized way:
Code: [Select]
:ClrDraw
:GetCalc("appvPIC",Y0) //recalls pic from archive and stored in Y0
:Copy(Y0,L6,768) //copies it into L6 (buffer)
:DispGraph
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:26:54 pm
k
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:28:22 pm
lol you posted right after I edited
Title: Re: Trying to get this to work
Post by: Yeong on October 28, 2011, 08:29:35 pm
Optimized recalling appvar pic

:GetCalc("appvPIC",Y0)
:ClrDraw
:Copy(Y0,L6,768)
:DispGraph

8)
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:30:13 pm
ooh that is WAY more optimized
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:32:27 pm
 :banghead: :banghead: :banghead: :banghead: :banghead:

So.... How do I put my pic into an apvar?
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:32:41 pm
don't get it?
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:35:03 pm
I have 3 questions:

Why wont my pic0 work?
Why doesnt my background work?
How can I stop my title screen text blinking?
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:37:48 pm
pic into appvar:
(quote from yeongJIN_COOL :))
To Store Pic in appvar:
(just create a temp program to do this)

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

put an arrow on the screen? can you elaborate on that? (now I sound like eliza lol ;))
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:39:21 pm
Do I have to use an appvar? I have an arrow sprite and I just want to display it on the screen

Here's what happens with my code:
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:41:08 pm
of course you don't have to use an appvar.
arrow sprite: Pt-On(X,Y,Pic1)
is that what you need?

EDIT: try doing Fix 5 at the beginning of the program. It might help.
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:42:54 pm
I used that and it usually works.

I used
Pt-on(x,y,rotC(Pic0)
Title: Re: Trying to get this to work
Post by: jacobly on October 28, 2011, 08:44:11 pm
It looks like you were drawing the background over the arrows in the first post, which is why they are not showing up.
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:45:50 pm
Oh. I just noticed that when I tried to recall my Pic9 background, It was blank, so I must have not even stored the background
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 08:46:46 pm
oh yeah duh :P I am stupid.
doing the pic recall erases it. (the buffer)
do it at the beginning and do storepic, or whatever ;)
Title: Re: Trying to get this to work
Post by: Builderboy on October 28, 2011, 08:49:49 pm
hmmm...
my expirience with pics is: DON'T!
I always use appvars, easier to store, recall, and doesn't take up precious pic space.
whenever I use a OS pic, it puts the pixels wherever it wants.

Really?  I use OS Pic's all the time and never have they ever given me any problems.  I think they are also much much more useful than appvars because appvars can't be compiled directly into the code.  And since the picture variables are compiled into the program, you can delete them when you are done, freeing up that precious pic space. 
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:52:23 pm
This happened to me twice now. I run the program once, and it works great. Second time, the Pic9 is erased.
Title: Re: Trying to get this to work
Post by: Builderboy on October 28, 2011, 08:56:55 pm
The pictures on the first post don't show the entire program, could you post the entire source in text?
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 08:58:23 pm
Im going to make a few adjustments and then get the code

Edit: Screw it, Im getting the code first

Double Edit: Here is is

Code: [Select]
:.ROBOGUN
:1→G
:[081C2A4908080808]→Pic0
:[F080800000000000]→Pic1
:[FCA0A02000000000]
:[FFFCA0A080000000]
:[FCFFFC4848484000]
:[F8FFFFF848484850]
:[F8FFFFFFFC6C6C6C]
:Repeat getKey(15)
:Text(35,1,"RoboGun")
:Text(42,8,"V1.0"
:Text(1,55,"New Game"
:Text(60,55,"Load Game"
:copy([Pic9],L6,768)
:Pt-On(75,47,ShadeNorm(Pic0)
:Pt-On(12,47,Shade_t(Pic0)
:DispGraph
:End

I think If I put the Text( after the background, it'll stop the blinking of the words a bit, right?
Title: Re: Trying to get this to work
Post by: Michael_Lee on October 28, 2011, 09:02:05 pm
Firstly, to stop the flickering, add a
Code: [Select]
Fix 5
somewhere at the top, and a
Code: [Select]
Fix 4
at the end of the program.

Second, I've never use OS Pic vars before -- is it safe to use a direct [Pic9] inside of a command?

Thirdly, try doing something like
Code: [Select]
[Pic9]->Pic8
outside of the loop then doing
Code: [Select]
Copy(Pic8,L6,768)   .or whatever number
I don't know if that'll do anything, but it seems like it's worth a shot.

Fourthly, a bit random, but I'm assuming that RotC is run at compile time and returns a pointer to the rotated sprite data?  If so, couldn't you dereference that pointer and technically do RotC on it infinitely as long as you don't mind the code bloat?
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 09:03:47 pm
Does
Fix 5 draw text to the buffer or something?

Edit: With fix5, no text shows up.

Edit: Nvm I know why
Title: Re: Trying to get this to work
Post by: Michael_Lee on October 28, 2011, 09:05:45 pm
That's exactly what it does.  Everytime you do a 'DispGraph', you're actually destroying the text on the screen (because there's no text written to the buffer and the blankness overwrites what's on the screen).
Title: Re: Trying to get this to work
Post by: epic7 on October 28, 2011, 09:09:53 pm
Will [pic9]-> pic8 hopefully stop the deleting of my background?


Edit: It kinda does.... I compiled and ran multiple times, it worked. I compiled it again and my background was deleted.
Title: Re: Trying to get this to work
Post by: parserp on October 28, 2011, 11:52:37 pm
You could always store it to L3 (back buffer) and then do recall pic.