Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Keoni29 on October 22, 2011, 04:12:49 am

Title: Animated titlescreen optimizing code
Post by: Keoni29 on October 22, 2011, 04:12:49 am
The code for my animated titlescreen got really big. Can someone help me optimize it?
Code: [Select]
:Lbl TITLE
:copy(GDB20,L6,768
:DispGraph
:Pause 500
:copy(GDB21,L6,768
:DispGraph
:Pause 500
:Lbl F
:copy(GDB22,L6,768
:DispGraph
:Pause 500
:copy(GDB23,L6,768
:DispGraph
:Repeat getKey(54)
:For(30)
:SinReg1640,4000
:End
:For(A,0,300
:If getKey(15)
:Return
:End
:SinReg1100,1000
:End
:End
:For(A,0,5
:sub(NOISE,10,500
:copy(GDB22,L6,768
:DispGraph
:sub(NOISE,15,500
:copy(GDB23,L6,768
:DispGraph
:Pause 20
:End
:ClrDraw
:DrawInv
:DispGraph
:Pause 1000
Title: Re: Animated titlescreen optimizing code
Post by: AngelFish on October 22, 2011, 04:20:35 am
If you stored all the pictures in one GDB variable, the code looks something like this:

Code: [Select]
While(screen active)
copy(gdb+O,L6,768)
O+768^(768*number of frames) ->O
pause 500
end
Title: Re: Animated titlescreen optimizing code
Post by: Happybobjr on October 22, 2011, 09:27:55 am
can u show us the pictures? there is a possibility for optimization there.
Title: Re: Animated titlescreen optimizing code
Post by: Keoni29 on October 22, 2011, 09:29:53 am
I use OS pictures. Those are a given size isn't it? (if it aint there is some space black I can cut off)
Title: Re: Animated titlescreen optimizing code
Post by: Camdenmil on October 22, 2011, 09:42:56 am
They can be different sizes but you have to create them with axe. You can make a program that will copy all the pics you use into one and you could get rid of the unused black space in the process. note: if you defined all the pics one right after another, they are all right after eachother in memory. Example:

Code: [Select]
Pic1->GDB1
Pic2->GDB2
Copy(GDB1+768,L6,768) ;displays Pic2
Title: Re: Animated titlescreen optimizing code
Post by: Happybobjr on October 22, 2011, 09:44:00 am
well, it is highly likely in an animated title screen, that the next frame will have similarities with the prior, thus we oonly have to do a little shifting around.
Title: Re: Animated titlescreen optimizing code
Post by: Keoni29 on October 22, 2011, 09:46:46 am
They can be different sizes but you have to create them with axe. You can make a program that will copy all the pics you use into one and you could get rid of the unused black space in the process. note: if you defined all the pics one right after another, they are all right after eachother in memory. Example:

Code: [Select]
Pic1->GDB1
Pic2->GDB2
Copy(GDB1+768,L6,768) ;displays Pic2
Do I have to export in plain hex code?
well, it is highly likely in an animated title screen, that the next frame will have similarities with the prior, thus we oonly have to do a little shifting around.
Nah it's a fading in/out animation. You cant do that.
Title: Re: Animated titlescreen optimizing code
Post by: Happybobjr on October 22, 2011, 09:48:49 am
can you give us a screeny?
if it fades in and out, you can just use shade()....
Title: Re: Animated titlescreen optimizing code
Post by: Keoni29 on October 22, 2011, 09:50:37 am
Nope it's more complex than that.
(http://www15.speedyshare.com/files/30865978/download/Herocore%20footage2.gif)
Title: Re: Animated titlescreen optimizing code
Post by: Happybobjr on October 22, 2011, 10:02:27 am
can you make a screeny of just the title screen please....
and put it in25% speed in wabbit.
Title: Re: Animated titlescreen optimizing code
Post by: Keoni29 on October 22, 2011, 10:05:12 am
Why? I have posted a screenshot in the post above you.
(http://www11.speedyshare.com/files/30867315/download/Titlescreen.gif)
Title: Re: Animated titlescreen optimizing code
Post by: Happybobjr on October 22, 2011, 10:16:54 am
i see the screeny for 40 sec or so.  only 3 of which are the title screen....
thanks

HOw many bytes is it right now?
Title: Re: Animated titlescreen optimizing code
Post by: Stefan Bauwens on October 22, 2011, 10:56:43 am
I love the screenshots. For some reason they are not visible for me. But when I right click them I can view them.
Title: Re: Animated titlescreen optimizing code
Post by: Keoni29 on October 22, 2011, 11:13:23 am
Never mind people. It's optimized a lot right now ;D
Title: Re: Animated titlescreen optimizing code
Post by: Happybobjr on October 22, 2011, 12:06:42 pm
I love the screenshots. For some reason they are not visible for me. But when I right click them I can view them.

they disappear for some reason on me.  then after 80 or so refreshes, they reappear.
Title: Re: Animated titlescreen optimizing code
Post by: Keoni29 on October 22, 2011, 12:34:26 pm
Ye happens to me too, but it's just a bad host I guess.