Grayscale On Classpad?
#1
Posted 16 May 2005 - 05:54 PM
The game runs very fast so TRUONG must be using some tricks.
#2 Guest_Guest_mkanter_*_*
Posted 17 May 2005 - 11:11 AM
TRUONG The Vinh has created the game Asprin for the ClassPad which uses grayscale! There is a lot of flicker so it isn't optimized, but I'd be interested in knowing how this was accomplished.
The game runs very fast so TRUONG must be using some tricks.
Maybe he has read my reply in the cpsdk forum. I wrote there something like this:
...The LCD is slow ... Use multiple pictures (4 or so) render them and then display them short time after each other ...
The grayscale comes from the difference in the pixels (if the pixel is set in only 1 picture it will give a light gray, if this pixel os set in all pictures it will give a full black) Thats why there's the flicker...
If you want a 50% gray set the pixel in 50% of the pictures. (Simplest way would be to set the first 50% (with 4 pictures at all: the first 2) but it's better to set it using an pwm style (with 4 pictures at all: the first and the third picture). This may rduce the flicker
If you want more grayscales you may use more pictures, but this slows the rest...
Don't use the build in message pump. Create your own. An infinite loop will give the highest speed.
#3
Posted 18 May 2005 - 05:27 AM
I am saying for sure that the person who developed this game is Vietnamese ( or at least, have something relates to Vietnam ) because his name, TRUONG THE VINH, is completely Vietnamese name. In Vietnamese it should be: TRƯƠNG Thế Vinh.
OK, I want to ask a "very stupid" question: What is GRAYSCALE ? I have read this many times, but I still have no knowledge about. I am glad to see someone out there can help me to explain it ?
Thanks.
#4
Posted 18 May 2005 - 08:58 AM
#5
Posted 30 May 2005 - 09:18 AM
TRUONG The Vinh has created the game Asprin for the ClassPad which uses grayscale!
A.S.P.I.R.I.N !!! You forgot the I !!!
I used the source code of the addin test1 on www.classpad.org.
To have grayscales I added that :
char col; while(1) { if(++col > 1) col = 0; BeginDraw(); DrawFrame(); if(col) //what you want to draw in grayscales EndDraw(); }
But do you think it may be faster if I use PegScreen instead of PegThing?
#6
Posted 31 May 2005 - 01:55 AM
One thing that would be quicker is to access the video buffer in the BIOS directly, but this is not supported. "Not supported" isn't necessarily a bad thing, it just means if the hardware or low level BIOS were to change your code might not run.
#7
Posted 31 May 2005 - 05:57 PM
#8
Posted 31 May 2005 - 06:36 PM
The ClassPad has a fast CPU. The only reason is doesn't have grayscale isn't for technical reasons. It just hasn't been done yet.Hmm interesting. I was always wondering why gs wasntt possible on the cp300, is it because its too slow or because the LCD refresh state is too fast?
#9
Posted 01 June 2005 - 09:04 PM
draw a sprite. Save your picture 1. Lets assume the sprite look like the one right to the top-most cavern wall like this:
http://www.ticalc.or...te_making_1.gif
Now fill all the white areas in the sprite with black pixels (the sprite here act as a guide) and erase the black areas, save this as another pic. It should look like this:
http://www.ticalc.or...te_making_2.gif
now you need to display the first pic ina program, then switch back and forth very quickly all grey areas in the sprites by displaying the second pic using the XOR logic (actually in my technique the second pic acted as a sort of mask creatig the grayscale). Now comes the problems. I dunno how fast it would run but if it flicker badly I would suggest now going bakc to the picture no 1, and fill the gray areas with a checkered like this:
http://www.ticalc.or...te_making_3.gif
this should create a optical illusion making your eyes think it doesnt flicker, so you dont get a seizure while playing the game
at the end it should give this:
http://www.ticalc.or...te_making_4.gif
I dunno if anybody will understand though, actually this info came from my BASIC Grayscale tutorial for the 83+SE and since I dont have a casio I cannot explain really well
http://www.ticalc.or.../358/35823.html
#10 Guest_Carlos Marquez_*
Posted 17 March 2006 - 02:37 AM
#11
Posted 17 March 2006 - 06:30 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users