Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: pimathbrainiac on May 21, 2013, 10:17:49 am
-
Well, I came up with a way to do 7 level (although not completely flicker-less) grayscale in Axe.
I used Hayleia's interrupt method for getting that nearly perfect refresh rate!
Here's the source:
:.PIC8
:
:FnOff
:
:ClrDraw{^r}{^r}
:
:[FFFFFFFFFFFFFFFF]→Pic1
:
:0→T
:
:det(768,0)→C
:
:det(768,0)→B
:
:det(768,0)→A
:
:For(Y,0,7)
:Pt-On(8,Y*8,Pic1,C)
:Pt-On(32,Y*8,Pic1,C)
:Pt-On(48,Y*8,Pic1,C)
:Pt-On(16,Y*8,Pic1,B)
:Pt-On(40,Y*8,Pic1,B)
:Pt-On(48,Y*8,Pic1,B)
:Pt-On(24,Y*8,Pic1,A)
:Pt-On(32,Y*8,Pic1,A)
:Pt-On(40,Y*8,Pic1,A)
:Pt-On(48,Y*8,Pic1,A)
:End
:
:FnInt(D,0)
:
:While 1
:EndIf getKey(15)
:LnReg {^r}
:Return
:
:Lbl D
:!If (T++^5)
:DispGraph(A,C){^r}{^r}
:DispGraph(B,A){^r}{^r}
:End
:Return
Do you see the secret? It's buffers! Instead of using the default buffers, I created 3 buffers that have different weights. They go as follows:
none: 0/6
C: 1/6
B: 2/6
A: 3/6
You can not repeat buffers, but you can add them up to get all values 0-6 out of 6
The key in the code is this section (the only one I will explain)
:Lbl D
:!If (T++^5)
:DispGraph(A,C){^r}{^r}
:DispGraph(B,A){^r}{^r}
:End
:Return
The front buffer gets a weight of 2/6, and the back, 1/6. Add up the totals, and you get A=3, B=2, and C=1!
So long as you get those totals, it doesn't matter how you display the graph (within the interrupt or not) (which makes it less flickery, but more inconsistent)
That's it! Pretty simple, eh?
Good luck, and may the grayscale be with you!
-
It's seem great !
But....
One thing to said :
just don't use this :
!If (T++^10)
remove the parenthesis because they are useless...
and you should precise that you have to change the value after ^ (or not) to find the perfect greyscale lvl of one calc (It's just test, though)
-
It's seem great !
But....
One thing to said :
just don't use this :
!If (T++^10)
remove the parenthesis because they are useless...
and you should precise that you have to change the value after ^ (or not) to find the perfect greyscale lvl of one calc (It's just test, though)
That's true.
Also: it should be T++^5. Editing the post
-
Tht's pretty awesome, 7 level greyscale! :D/me expects games >:D
-
Screenies? :P
-
Not quite yet. I think I may have the right stuffs now to make nearly thepenguin77 good 8 level.
(hint hint: masking)
-
That is great :D
That could be useful for games where there is not a lot of movement.
And glad my method could be of any use :)
-
Well, wabbit doesn't like programs meant to show new grayscale techniques, but here's a screenie:
-
Well, wabbit doesn't like programs meant to show new grayscale techniques, but here's a screenie:
It may depend on your settings. Sometimes using "Steady Freq" with well chosen frequence and number of shades make grey look perfect on Wabbitemu.
-
Wabbitemu's grayscale often gives the best result when it's set to the number of shades you want to show, or when it's set to a multiple of that.
-
Yeah, just play around with wabbits settings and you can get the greyscale to look perfectly :)