Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: pimathbrainiac on May 21, 2013, 10:17:49 am

Title: [TUTO] 7 level interrupt grayscale in Axe
Post 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:

Code: [Select]
:.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)

Code: [Select]
: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!
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: TheMachine02 on May 21, 2013, 11:38:11 am
It's seem great !
But....
One thing to said :
just don't use this :

Code: [Select]
!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)
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: pimathbrainiac on May 21, 2013, 11:39:55 am
It's seem great !
But....
One thing to said :
just don't use this :

Code: [Select]
!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
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: Sorunome on May 21, 2013, 08:05:09 pm
Tht's pretty awesome, 7 level greyscale! :D/me expects games >:D
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: Ki1o on May 21, 2013, 08:08:28 pm
Screenies?  :P
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: pimathbrainiac on May 21, 2013, 08:39:09 pm
Not quite yet. I think I may have the right stuffs now to make nearly thepenguin77 good 8 level.

(hint hint: masking)
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: Hayleia on June 01, 2013, 01:36:33 pm
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 :)
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: pimathbrainiac on June 06, 2013, 06:57:36 pm
Well, wabbit doesn't like programs meant to show new grayscale techniques, but here's a screenie:
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: Hayleia on June 07, 2013, 01:11:31 am
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.
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: ben_g on June 07, 2013, 02:25:37 pm
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.
Title: Re: [TUTO] 7 level interrupt grayscale in Axe
Post by: Sorunome on June 07, 2013, 05:46:08 pm
Yeah, just play around with wabbits settings and you can get the greyscale to look perfectly :)