I think it's important for general developers to support OS 3.1.
The hardest thing I found was dealing with 4-bit graphics which goes
beyond a simple email.
But if you are content with 1 or 2-bit mode, emulating WinScreenLock is
very easy. (Although I feel not needed in light of the slow LCD refresh
rate and fast screen drawing speed of those devices.)
After checking the ROM version, make sure that the Processor Type is a
68328 or 68328 EZ. (This is overkill as we know of no devices with OS
3.1 which use any other CPU.)
Then, verify this a Palm that uses the 68328 or 68328EZ for its
graphics. We made the assumption that if the ROM version was >= 3.1 and
< 3.5 AND WinScreenMode returns that color is not supported, than we are
dealing with a gray Palm using 68K graphics. (This is overkill, as we
know of know color Palm that used OS 3.1, but you can never be too
safe. We also know of no gray Palm that used a different LCD controller
from the CPU.)
You need to allocate an alternate screen buffer. Then, to switch the
screen to show your buffer (equivalent to a WinScreenUnlock()), all you
do is set memory location $FFFFFA00 to your buffer address.
This LCD register is the same on both the 68328 and 'EZ, but the 'EZ has
more buffer restrictions, so go with these:
(1) Your buffer address must be divisible by 2 -> any PalmOS malloc does
this.
[address & 1 == 0]
(2) Your entire buffer must reside below memory location 268,435,456 (28
bit screen addressing):
[ (address + screensize - 1) < $10000000 ]
(3) Your entire buffer must fit within the same 128K boundary:
[ (address & ~131071) == ( (address + screensize - 1) & ~131071) ]
THE CATCH -> SUPPORTING THE PALM OS:
Before you start changing $FFFFFA00 you MUST save the original, "safe"
screen location as this is where the PalmOS thinks the screen is.
Your program must then catch any "hard" or "soft" interrupts (we define
hard interrupt == appStopEvent, soft interrupt == any OS overlay dialog
like FIND, Alarm, Contrast, Keyboard, etc) and ALWAYS set the screen
location back to the original, safe location before the interrupt
occurs.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/