PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

fading method

Hey,

i am coding a fade algorithm for a GAPI-based game for the iPAQ. Now i checked the iPAQ's hardware specs and it seems to be possible to adjust the brightness of the screen with 255 steps rather than the few ones that the brightness utility allows for. The advantage of this would be to have a fade algorithm that consumes almost no CPU cycles, like it  was possible in the good ol' days of DOS coding.

Do you have an idea of how to access the LCD stuff directly to change that settings?

thanx

The iPaq uses a reflective screen. If you totally dim the display light, then you can still see the display based on ambient light. In bright settings outdoors or in a vehicle in daylight, you can't even tell when the sidelight is on. So in other words, that technique would not be as effective with a reflective display compared to a conventional backlit display.

Dan East
and also, it might not work on other PPC's - depends on hardware manufacturer, therefore it isn't a really good method... anyway if you use a backbuffer, simple do the fade during backbuffer->frontbuffer copy. It should be quite fast...
thats exactly what im doing now... i do the fading during the backbuffer copy, but its quite slow. Well, its just the first working version, but i do it the slowest way, just getting the RGB values from the current pixel and decrementing by one according to the speed of the fade. I will implement it using lookup tables and masks, i think it should be fast enough then.

In the Nutcracker, I also do full-screen fades. I used interlacing to get it fast: On even frames, fade only even lines, on odd frames, fade only odd frames. If you take this one step further (four frames, and a modulo 4 for the scanlines) it is even fast enough on the HP pocketpc's. Don't forget to link your fader to the clock, otherwise it will be too fast on an iPaq and too slow on a HP.