Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: willrandship on December 07, 2010, 06:44:24 pm
-
The process is fairly simple:
Have 2 greyscale sprites
One Displays, then the other, in rapid succession.
easy code example:
[ffff0000ff00ff00]->Pic1F
[ff00ffff00ff00ff]->Pic1B
[ffffffff00000000]->Pic2F
[ffffff00ffff0000]->Pic2B
ClrDraw
ClrDrawr
repeat getkey(15)
Pt-Off(0,0,Pic1F)
Pt-Off(0,0,Pic1B)r
DispGraphrr
Pt-Off(0,0,Pic2F)
Pt-Off(0,0,Pic2B)r
DispGraphrr
End
It gives a very scanlined Grayscale, but the values go as follows:
(Value, 1st Pic Gray, 2nd Pic Gray, ranging 0-7 and 0-3 respectively)
0,0,0
1,1,0
2,1,1 (2,0 looks the same, but is more flickery)
3,0,3
4,1,2
5,1,3
6,2,3
7,3,3
Simple process. Some optimization (or Asm rewrites for built-in commands, dispgraphrrr anyone? :P) and it could be rather smooth! On my nspire, they're all quite flickery, but I got to try it for a tiny bit on an 83+, and it looked much better. I had not yet tested all the shades, though. :w00t:
-
interesting
-
I'm not sure exactly how close a few (3 and 4, among others) are in shade, since the nspire sucks at greyscale :P
I tried with 4-level and 3-level once (would have had smoother shades) but the timings didn't work out, and it ended up just being solid 3-level.
-
since the nspire sucks at greyscale
how DARE they use higher end lcd's?!!
ima try this out soon to see how well it runs on the 84+.
-
Hey, it's their emu that sucks at not seeing greyscale images and using their hardware-driven stuff. :P
-
Can someone screen this?
-
Huh, I couldn't get it to work really on my 84+ :( I checked my code twice but all I'm getting is two solid lines of black, a row of alternating black and gray pixels, two rows of that last row reversed, two rows of gray, and one row of alternating gray and blank pixels ??? So I don't know why it's not working for me :( But seems like a cool idea/program.
-
Hmm.....Strange. Did you try it with Full? On the Nspire it doesn't do anything, but hey, it might have some effect for the 84+ screens. It sounds like your screen is better than mine :P
-
You should post a 8xp or something, I would like to see how this looks like :D
EDIT: Nvm I just copied it on calc. Seems nice, but if I fill the entire screen with sprites it looks really crappy. It might be ok for games with very few sprites displayed in 15 MHz mode, but it might be unpractical otherwise. :(
-
Hmm.....Strange. Did you try it with Full? On the Nspire it doesn't do anything, but hey, it might have some effect for the 84+ screens. It sounds like your screen is better than mine :P
Ya, I tried in 15MHz and 6MHz mode. When in 15MHz mode it has a heavy scan line that goes from top to bottom on the gray parts. 6MHz mode is exactly what I described. I don't know if it's a typo in your code, my code, or something just weird.
-
Can you tell me if this code works.
[ffff0000ff00ff00]->Pic1F
[ffffffff00000000]
[ff00ffff00ff00ff]->Pic1B
[ffffff00ffff0000]
ClrDraw
ClrDrawr
0=>A
repeat getkey(15)
1-A=>A
Pt-Off(0,0,A*8+Pic1F)
Pt-Off(0,0,A*8+Pic1B)r
DispGraphrr
End
-
This seems to work, although I wonder what does A do?
-
DJ: This was intended to make a few things on the screen higher level (like characters) while the rest is still 4 level.
That appears to be swapping between the two sprites, and optimizing the code, by having a go 1,0,1,0, but why not use not(a->a?
also, does ++ no longer work?
-
I usually do it like that.
-
An exemple of code to see 8 level grayscales :
:.GRAY8
:[0000000000000000→Pic1
:[FFFFFFFFFFFFFFFF]
:0→A→B→C
:Repeat getKey(15)
:sub(GR)
:DispGraph<sup>r</sup><sup>r</sup>
:End
:Return
:
:Lbl GR
:ClrDraw
:ClrDraw<sup>r</sup>
:1-C→C
:For(Y,0,7)
:For(X,0,11)
:If X+1^2+C
:If 1-A→A
:1-B→B
:End
:End
:Pt-Off(X*8,Y*8,B*8+Pic1)
:Pt-Off(X*8,Y*8,A*8+Pic1)<sup>r</sup>
:End
:End
Top left, there is in order:
black and black, black and gray 75%, gray 75% and gray 25%, gray 75% and white, gray 25% and black, gray 25% and gray 75%, white and gray 25%, white and white.
B change buffer and A back-buffer. C alternates between two screens imaginary.
Actually there is only 7 grayscale (gray 75% and gray 25% = gray 25% and gray 75%).
EDIT : Woa, it work perfectly with full mode.
-
Woah that looks great! I wonder how it looks like on-calc... is the blinking very visible?
-
An exemple of code to see 8 level grayscales :
:.GRAY8
:[0000000000000000→Pic1
:[FFFFFFFFFFFFFFFF]
:0→A→B→C
:Repeat getKey(15)
:sub(GR)
:DispGraph<sup>r</sup><sup>r</sup>
:End
:Return
:
:Lbl GR
:ClrDraw
:ClrDraw<sup>r</sup>
:1-C→C
:For(Y,0,7)
:For(X,0,11)
:If X+1^2+C
:If 1-A→A
:1-B→B
:End
:End
:Pt-Off(X*8,Y*8,B*8+Pic1)
:Pt-Off(X*8,Y*8,A*8+Pic1)<sup>r</sup>
:End
:End
Top left, there is in order:
black and black, black and gray 75%, gray 75% and gray 25%, gray 75% and white, gray 25% and black, gray 25% and gray 75%, white and gray 25%, white and white.
B change buffer and A back-buffer. C alternates between two screens imaginary.
Actually there is only 7 grayscale (gray 75% and gray 25% = gray 25% and gray 75%).
EDIT : Woa, it work perfectly with full mode.
sick man!
and I think there really is a difference between those tow, just very slight, so yeah it is 8 level :)
-
Woah that looks great! I wonder how it looks like on-calc... is the blinking very visible?
Correct on 83+.
And now, 16 grayscales >:D
Here a gif with wabbitemu :
-
That screenshot looks nice.
-
Woah that looks great! I wonder how it looks like on-calc... is the blinking very visible?
Correct on 83+.
And now, 16 grayscales >:D
the cake is a lie!
/me wonders what 32 color looks like...
edit: and c.sprinkle I see you are now on omnimaga too from cemetech! welcome! :D
-
Limit is.... 144 grayscales :banghead:
EDIT : approximately.
-
woot 144 greyscales...
-
That looks pretty cool.
Ashbad:
Chances are if nobody's posting on Cemetech, someone is here and vice versa. That way I can always have someone to discuss programs with.
-
holy shit...
your gray scale routine in pure axe is the best I've ever seen...
/me hands kindermoumoute the Nobel prize for politics
(http://www.cybernations.net/images/lovetoo.gif)
c.sprinkle: I figure the same, though I check cemetech 30% of time and omnimaga 70% of time
-
holy shit...
your gray scale routine in pure axe is the best I've ever seen...
/me hands kindermoumoute the Nobel prize for politics
(http://www.cybernations.net/images/lovetoo.gif)
c.sprinkle: I figure the same, though I check cemetech 30% of time and omnimaga 70% of time
An entire evening making head to look for this algorithm instead of revising my courses. :love:
-
I suppose that means you spend a lot of time posting???
:)
-
That looks pretty cool.
Ashbad:
Chances are if nobody's posting on Cemetech, someone is here and vice versa. That way I can always have someone to discuss programs with.
Heya welcome on Omnimaga! And yeah I agree that both forums got plenty of calculator fans to discuss with plus plenty of varied discussions. I hope you enjoy your stay in the community. :)
Limit is.... 144 grayscales :banghead:
EDIT : approximately.
O.O
I really need to try on calc, though. I wonder if it would be practical to use 16 level inside a game in 15 Mhz mode? Sprites might become pretty large in size.
I think I'll dig up my TI-83 Plus Silver Edition and see how it looks like later. :)
-
so...if you implement this on games, will it slow down a game a lot?
-
Yeah, probably. The grayscale support for three and four- color is pretty fast, but higher is slowing down by a noticeable amount.
-
Holy!!!! :o O.O 144 shades!?!?!? That's :crazy: Good job man :thumbsup: I wonder if this has even been done before with pure ASM.
-
A main reason why not much more than 4-level grayscale has been done before is because the screen driver is so slow. Even if a program theoretically uses a high level of grayscale, the screen and driver are physically incapable of producing much more than a somewhat solid-looking 8-level grayscale.
-
True. This is also why we need to interlace grayscale like this (the scanlines). Without the scanlines, it would blink like mad, even in 3 or 4 level grayscale. That's how crappy the LCD driver is. I tried xLIB 3 level grayscale once and even though it involves BASIC code, I still had to slow the grayscale updating down to keep it somewhat synced with the LCD and preventing it from looking horrible.
-
Other funny stuff : random grayscales.
(http://img4.hostingpics.net/pics/167902Randomgrayscale.gif)
-
^ that would be a beastly special effect in a game.
-
That looks very good kinder!
-
I have revised my calcul: in fact all the screens shown above was displaying no more than 7 levels of gray!
In Axe Parser, the screen can display 4 grayscale from 0% (white), 33%, 66% and 100% (black).
When we alternate on the screen 2 imaginary memory screens, we obtain 7 levels of gray : 0%+0%=0%, 0%+33%=16,5%, etc.
That is exactly what we find here :
(http://img718.imageshack.us/img718/6526/8grayon84full.gif)
(the 3rd and 6th tile are identical)
Then when we add a third screen in memory, we get 10 levels of gray : 0%+0%+0%=0%, 0%+0%+33%=11%, etc.
That's what we have here :
(http://img219.imageshack.us/img219/6958/wabbitemu.gif)
(hard to discern, but they are all here)
So on : with a 4th screen we get 13 levels of color. Briefly, it is far from the 144 levels of gray.
From 10 grayscale screen flashes.
For your eyes I've made a screen composed of 13 levels of gray, I don't see them all, but they are there.. :D
(http://img841.imageshack.us/img841/2201/13grayscales.gif)
-
I have revised my calcul: in fact all the screens shown above was displaying no more than 7 levels of gray!
In Axe Parser, the screen can display 4 grayscale from 0% (white), 33%, 66% and 100% (black).
When we alternate on the screen 2 imaginary memory screens, we obtain 7 levels of gray : 0%+0%=0%, 0%+33%=16,5%, etc.
That is exactly what we find here :
(http://img718.imageshack.us/img718/6526/8grayon84full.gif)
(the 3rd and 6th tile are identical)
Then when we add a third screen in memory, we get 10 levels of gray : 0%+0%+0%=0%, 0%+0%+33%=11%, etc.
That's what we have here :
(http://img219.imageshack.us/img219/6958/wabbitemu.gif)
(hard to discern, but they are all here)
So on : with a 4th screen we get 13 levels of color. Briefly, it is far from the 144 levels of gray.
From 10 grayscale screen flashes.
For your eyes I've made a screen composed of 13 levels of gray, I don't see them all, but they are there.. :D
(http://img841.imageshack.us/img841/2201/13grayscales.gif)
Great stuff!
I wish on-calc 8 level grayscale flickered less than WabbitEmu, because it would be epic to have in game. :DOther funny stuff : random grayscales.
(http://img4.hostingpics.net/pics/167902Randomgrayscale.gif)
That looks great too, but when you create animated screenshots, when you start gif capture, you should wait at least 8 hours before running the program into the screenshot. :P
http://ourl.ca/6245
-
Sorry, first time I do it. :D
-
No problem, I was being sarcastic in reference to how, 6 months ago, people waited extremly long in their screenshot to actually start the program then people had to wait 2-3 minutes before something cool happens. :P
-
That is pretty cool. I wish you could speed the calc up so this would be useable.
-
well, when sped up, it is still pretty flickery -- while it is not the fastest way to do 8 level (a faster way is possible in asm where you create scan lines and send the result directly to the lcd)
^that method I just mentioned can be almost flickerless, ALMOST. But 4 level can be pretty perfect if you do it right :)
-
Looks nice Kinder. :)
I wonder if calc84 would write an 8 level greyscale Axiom... ;D
-
^ That would rule. I don't know if I would use it much, though, because on the regular 83+ you can only see about 6 shades of gray. :( (contrast is too sparse)
-
^What DJ said. 8 is doable, but some of the shades are not very distinguishable from one another on calc. =(
-
Well, 7 is just about what I could get on my nspire, with the code I posted at the top. kindermoute, how did you get it to run that fast with the screen full of sprites? O.O
-
Ok, if i've time, i'll post commented code.
-
^What DJ said. 8 is doable, but some of the shades are not very distinguishable from one another on calc. =(
Well it depends. On the 83+SE and the 84+ it looks pretty fine. It's just on the old 83+ that it looks crappy.
-
Ah, when I had Ti1plea's 8 level demo on my 83+ SE, it looked ok, but some of the lighter shades were really hard to see and a some of the dark ones looked similar. In my case, it actually looked better on my regular 83+ BE. Go figure, Ti with there crappy inconsistent LCDs...
-
Strange, I guess my old 83+ has a crappier LCD. But again, if you got an even older 83+ it might be why on yours it looked better.
-
I got it second hand so I have no idea. I just wish their product quality levels were more consistent. :/
-
Me too. It makes it impossible to have the same grayscale quality on all calc. Everyone has to test and the programmer has to calibrate. I think most people gave up on that and now try to make grayscale just look good enough instead of nearly perfect.
-
*bump* probaly I jsut have a crappy LCD but if I set the program on the end of page 1 to Full it doesn't work in the sense that it displays all kinds of garbage all over the freaking place. I did run ALCDFIX before trying, same result.
Any clue on why this happens?
-
*bump* probaly I jsut have a crappy LCD but if I set the program on the end of page 1 to Full it doesn't work in the sense that it displays all kinds of garbage all over the freaking place. I did run ALCDFIX before trying, same result.
Any clue on why this happens?
Does it set it to Normal right before DispGraphrr?
Because the DispGraphr and DispGraphrr only work in 6Mhz mode. You could have the code set Normal right before the DispGraphrr and Full right after, though.
-
Me too. It makes it impossible to have the same grayscale quality on all calc. Everyone has to test and the programmer has to calibrate. I think most people gave up on that and now try to make grayscale just look good enough instead of nearly perfect.
I figured out how to combat the poor 4 level gray display on the 83+ -- by using 8 level gray :D
basically, all you have to do is change the 4 level routine to 8 level display, but still only read from 2 buffers. Then for the two grays, you pick the two colors closest to 50% gray, and it should work fine and look fantastic, but a bit more flickery :)
-
You mean you just flash those additional levels of gray? I think Calc84maniac actually just used more spaced scanlines actually. In calc84's case, I think it takes 3 sprites.