Porting SDL to Palm OS

Hi folks,

We’re starting this port in the next days. We plan to do a simple port at first
(just calling Palm OS routines), and after, do the deeper port, including the
graphic primitives for direct screen access.

Our intention is to provide the driver to the community and add it to SDL. Our
second intention is to port SuperWaba to run on top of SDL. This last one is
already done, but since SDL API lacks the specifities of a PDA, we still have
to do some magics around.

SuperWaba supports, since 2002, all possible screen depths available for Palm
OS. This means:

2bpp grayscale mode: Palm Professional, Palm III, Palm V - very old devices
4bpp grayscale mode: Palm Vx, Zire 21, Treo 300, and many others
8bpp palettized-color mode: Palm IIIc, M130, M505, some others

The routines for these 3 modes are done in Assembly 68000, and are part of
SuperWaba’s source code (i wrote it in 2002).

The 16bpp hicolor mode uses the native Palm OS calls, present in most Tungsten
and other models.

I got the excellent article that Stephane Marchesin wrote about “Porting SDL”,
and it will help us start the port.

But, there’s already a first glych: SDL does NOT support less than 8bpp screens
(see sourceFormat->BytesPerPixel). So, how to define 4bpp screens? (we’re
willing to drop the support for 2bpp devices because they almost disappeared).

If anyone else wants to help on this port, lemme know and i may provide access
to our private repository.

thanks

Guich

ps: more on superwaba at www.superwaba.org /com/com.br/net

Nice job! I am just looking for SDL port to PalmOS since the
game development only whit original PalmOS SDK is quite difficult.

PS: HiRes support of SuperWaba seems a bit weak, for example,
320*480 of Sony Clie and Palm TT3

“Guilherme Campos Hazan” > We’re starting this port in the next days. We plan to do a simple port at

first
(just calling Palm OS routines), and after, do the deeper port, including
the
graphic primitives for direct screen access.

Guilherme Campos Hazan wrote:

2bpp grayscale mode: Palm Professional, Palm III, Palm V - very old devices
4bpp grayscale mode: Palm Vx, Zire 21, Treo 300, and many others
8bpp palettized-color mode: Palm IIIc, M130, M505, some others

The routines for these 3 modes are done in Assembly 68000, and are part of
SuperWaba’s source code (i wrote it in 2002).

What are these routines ? Blitting routines for example could very well
be integrated into SDL (they’d need to be in gas format, though).
There’s already some 68000 assembly code in SDL, btw.

But, there’s already a first glych: SDL does NOT support less than 8bpp screens
(see sourceFormat->BytesPerPixel). So, how to define 4bpp screens? (we’re
willing to drop the support for 2bpp devices because they almost disappeared).

I see two solutions :

  • add support in SDL for 2bpp & 4 bpp surfaces and screens. Might not
    always be backwards compatible with existing SDL programs (but might be
    a good candidate for the SDL 1.3 branch).

  • “fake” 8bpp support on 2bpp & 4 bpp devices. Conversion from 8bpp
    color to 2 or 4 bpp grayscale is probably straightofrward, but you’re
    wasting memory when storing everything as 8bpp. OTOH backwards
    compatibility is ensured.

Obviously, the first solution is cleaner.

Stephane

Hi Stephane,

What are these routines ? Blitting routines for example could very well
be integrated into SDL (they’d need to be in gas format, though).
There’s already some 68000 assembly code in SDL, btw.

There are several routines, but the main ones are: setPixel, getPixel,
drawHLine, drawVLine, drawBitmap (with several drawing modes), initGraphics.

  • add support in SDL for 2bpp & 4 bpp surfaces and screens. Might not
    always be backwards compatible with existing SDL programs (but might be
    a good candidate for the SDL 1.3 branch).

Yes, this is what i preffer. Since 0 is 8bpp, i was thinking in -1 become 4bpp
and -2 becore 2bpp.

Sam, do you agree with this?

thanks

guich

Indeed! I’d love to see some of my SDL games ported to PalmOS. It’s one
of the few systems out there they HAVEN’T been (and one of the more popular
ones that they haven’t been ported to!)

(Hrm, actually… I recall “Gem Drop X” was ported, but it must have been
from X11 or SDL directly to Palm’s API. I should try and find that game :wink: )

-bill!
bill at newbreedsoftware.com "Stand underneath a falling object and
http://www.newbreedsoftware.com/ explore the meaning of the word ‘@#%$!’"
New Breed SoftwareOn Wed, Aug 18, 2004 at 11:38:34PM +0800, RocWood wrote:

Nice job! I am just looking for SDL port to PalmOS since the
game development only whit original PalmOS SDK is quite difficult.

Guilherme Campos Hazan wrote:

Hi folks,

We’re starting this port in the next days. We plan to do a simple port at first
(just calling Palm OS routines), and after, do the deeper port, including the
graphic primitives for direct screen access.

How are you handling memory allocation? Last time I played with PalmOS,
you had to use memory “handles” and couldn’t rely on standard malloc(), etc.

This might have changed; the last PalmOS I used was the default that
shipped with the PalmIII…but I’m curious about it.

How uncommon are palm devices that can’t do 8-bit paletted or better
graphics? You’re going to find it non-trivial to add a 4-bpp codepath to
SDL, I suspect…you might want to consider either ignoring devices that
can’t do 8 or more bits, or expose an 8bit shadow surface on those
devicecs and convert to 4bpp during SDL_UpdateRect()…but I suspect the
platforms that could only do 4bpp couldn’t handle the expense of the
conversion. Then again, everything that is mainstream might be 16bpp at
this point for all I know.

People have been talking about a Palm port of SDL for a long time, and
generally the conclusion was that we’d have to wait for the hardware and
OS to catch up to “modern” systems to make SDL workable on those platforms.

I’d love to see someone finally manage to pull it off.

–ryan.

Hi there,

Is there an SDL port available for Palm currently? Is the project still
going, or has it died?

-Richard