Jump to content



Photo
- - - - -

Grayscale On Classpad?


  • Please log in to reply
10 replies to this topic

#1 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 16 May 2005 - 05:54 PM

TRUONG The Vinh has created the game Aspirin 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. B)

The game runs very fast so TRUONG must be using some tricks. :)

#2 Guest_Guest_mkanter_*_*

Guest_Guest_mkanter_*_*
  • Guests

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. B)

The game runs very fast so TRUONG must be using some tricks. :)

<{POST_SNAPBACK}>


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 Lovecasio

Lovecasio

    Casio Freak

  • Members
  • PipPipPipPip
  • 242 posts
  • Location:Hochiminh city Vietnam
  • Interests:Organic chemistry.<br />Pharmacy

  • Calculators:
    fx 570 MS, Casio AFX 2.0+, ClassPad 300

Posted 18 May 2005 - 05:27 AM

Hi.
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 ? :unsure: 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 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 18 May 2005 - 08:58 AM

greyscale is using any more than just black and white coloring for display (you use shades of grey)... look here: Posted Image

#5 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 30 May 2005 - 09:18 AM

TRUONG The Vinh has created the game Asprin for the ClassPad which uses grayscale!

<{POST_SNAPBACK}>


A.S.P.I.R.I.N !!! You forgot the I !!! :rant:

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 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 31 May 2005 - 01:55 AM

I don't think it matters because most of the PegThing draw functions are just in-line functions in the header that draw directly to the PegScreen. I think the most important thing is how the drawing is being done.

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 DJ Omnimaga

DJ Omnimaga

    Casio Freak

  • Members
  • PipPipPipPip
  • 123 posts
  • Gender:Male
  • Location:Quebec (Canada)

  • Calculators:
    Casio FX-7000G, FX-7400G+, FX-7700GE, FX-9750G+, CFX-9850G, AFX 1.0, FX-9860G, FX-9750gII, fx-CG10, fx-CP400, TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89 Titanium, TI-92, TI-Nspire, TI-Nspire CX, HP 39gII, HP Prime

Posted 31 May 2005 - 05:57 PM

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?

#8 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 31 May 2005 - 06:36 PM

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?

<{POST_SNAPBACK}>

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. ;)

#9 DJ Omnimaga

DJ Omnimaga

    Casio Freak

  • Members
  • PipPipPipPip
  • 123 posts
  • Gender:Male
  • Location:Quebec (Canada)

  • Calculators:
    Casio FX-7000G, FX-7400G+, FX-7700GE, FX-9750G+, CFX-9850G, AFX 1.0, FX-9860G, FX-9750gII, fx-CG10, fx-CP400, TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89 Titanium, TI-92, TI-Nspire, TI-Nspire CX, HP 39gII, HP Prime

Posted 01 June 2005 - 09:04 PM

I dunno if this might help but I felt like posting this anyway. Here is how I made my grayscale in TI-BASIC, 3 level of gray. The procedure might differ since I did that not only on a TI-83+, but in BASIC, not ASM/C. First You need two layers of course and my technique used the XOR logic ( if classpad wont use XOR logic and such stuff ignore my post)

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_*

Guest_Carlos Marquez_*
  • Guests

Posted 17 March 2006 - 02:37 AM

:banghead: I look for an example (code) in gray scale of an image in the classpad300.
:rant: :rolleyes:

#11 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 17 March 2006 - 06:30 PM

Impossible :( The author of the grayscales library (Gaumerie) didn't release it yet.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users