[p900] direct screen P900

  • From: Alfonso Martone <a.martone@xxxxxxxxxxx>
  • To: p900@xxxxxxxxxxxxx
  • Date: Fri, 16 Apr 2004 23:34:01 +0200

Studying the e32frodo code I found that one *can* use the UIQ screen 
directly, as the Good Old DOS/VGA times, when men were men and wrote 
directly in the graphics card buffer, without asking permission to the 
underlying operating system, and without caring of portability issues
:-)

#define SCREEN unsigned short  // as of gcc539arm-epoc-pe this is 16 bit

SCREEN *screenpointer()  // YES, this code was successfully tested
{
  TPckgBuf<TScreenInfoV01> info;
  UserSvr::ScreenInfo(info);
  return (SCREEN*)(info().iScreenAddress);
}

void directscreen()  // YAY!!! this just runs on my P900!!!
{
  SCREEN *ptr=screenpointer();  // initialize once
  ptr[208*305+197]=0x001f;      // write a full blue pixel at (197,305)

  SCREEN pixel=ptr[208*4+15];   // read pixel value at (15,4)
}

The TScreenInfoV01 object is defined in e32svr.h but the official 
documentation does not cover its usage. Anyways, the directscreen() 
function above does what you expect, and this is sufficient to say to 
you all "have fun with it" :-) You only need to remember that the bit 
mapping is 5-6-5 (5 least significant bits for blue, 6 center bits for 
green, 5 most significant bits for red). Don't forget that external 
events (for example a flip-close) set up a screen redraw for some 
OS-managed window (you could use one of those direct-screen classes to 
tell the system what you are doing, but I didn't investigate this yet).

Oops: little investigation here (one single link!!!)

http://developer.sonyericsson.com/site/global/techsupport/
tipstrickscode/symbian/p_dectectwhenp800screencoveropens.jsp



Other related posts:

  • » [p900] direct screen P900