-----Original Message-----
From: Idries Hamadi [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 5:33 PM
To: Palm Developer Forum
Subject: FW: Drawing performance (was Access screen with Palm OS 4.0)


Thanx alot for this, just using your FastBlit to copy my screen buffer to
the screen has made a significant improvment. I am planning to implement
somthing similar for drawing my bitmaps, I will probably restrict them to
multiples of 16 in width and horizontal position to save on shifting. 

------------------------------
You're welcome. How much significant ?
------------------------------

I don't know what a HIRES device is, can you explain this please (or point
me to a URL or somthing). 

------------------------------
There are some devices (Sony for example) whose screen resolution is
320x320.
There are also some more funny devices (240x240).
PalmOS (the HAL) hides this feature and pretend them to have 160x160 screens
but
you can use some extended APIs to access the high-resolution mode.
If you access the screen directly, you need to understand that it is
320x320.
Accessing the screen directly may also cause some bpp issues.
The new Treo 90 is apparently is 4-4-4 12bpp mode.
------------------------------

One other problem that I have is that my performance seems much lower on OS
3.5 plus roms (in POSE). I loose about half my framerate when going from
Palm III OS 3.0 to a Palm Vx OS 3.5.

The only thing that I am doing differently on 3.5 is the way that I access
the screen and the offscreen screen buffer:

        if (gOS35AndAbove)
        {
                screenPtr = (u1*)BmpGetBits(WinGetBitmap(screen));
                screenBufferPtr =
(u1*)BmpGetBits(WinGetBitmap(fScreenBuffer));
        }
        else
        {
                screenPtr = (u1*)screen->displayAddrV20;
                screenBufferPtr = (u1*)fScreenBuffer->displayAddrV20;
        }

gOS35AndAbove - true if OS version is greater than or equal to 3.5
screenPtr - the address to copy the screen buffer when I've drawn to it
screenBufferPtr - the address to draw to
screen - WindowHandle of the screen
fScreenBuffer - WindowHandle of the screen buffer (offscreen window same
dimentions as screen).

Apart from that everything else is the same, why is the second twice as fast
as the first? How can I get the screen address (and the buffer address) on
post 3.5 and still be upwards compatible (w/ OS 5 etc).

------------------------------
As Aaron said the OS itself is slower if you call SysHandleEvent too often.
Did you try calling EvtEventAvail and skip SysHandleEvent if none available
or are you calling EvtGetEvent with a (short) timeout value and always
calling SysHandleEvent ?
As Aaron also said, I hope that you are not executing the code above for
each frame.
This could well be factored out.
Actually your main loop should do as little as possible.
POSEr includes a "profiler" that you can use to see where your app is
spending too much time...
------------------------------

Thanx,
        Idries


------------------------------------------------------------------------
Regis NICOLAS - Engineering Director, Montpellier Site
Palm Computing Europe, a PalmSource, Inc. subsidiary
 
When the finger points to the sky, the idiot looks at the finger.


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to