[PATCH] iPod framebuffer video driver

Hi SDL-list,

I’ve been working on a port of SDL to iPodLinux
(http://www.ipodlinux.org). I’ve created a patch for both the
standard 2-bit iPod screen (using an unchangeable palette) and the
16-bit iPod photo. The patch is attached, against version 1.2.8.

I’ve created two pages on the iPodLinux wiki about this patch:
http://www.ipodlinux.org/Building_SDL and
http://www.ipodlinux.org/SDL_Programming. See those pages if you’re
curious.

Comments? Questions? Is this something that might be able to get into SDL 1.2.9?

Thanks for your feedback!
– Josh
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL-1.2.8-ipod.patch.gz
Type: application/x-gzip
Size: 7958 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050619/cc1a5a0a/attachment.bin

Cool!

So when’re we gonna see iVectoroids or iSuperTux? :wink:

-bill!On Sun, Jun 19, 2005 at 03:53:22PM -0700, Joshua Oreman wrote:

I’ve been working on a port of SDL to iPodLinux
(http://www.ipodlinux.org). I’ve created a patch for both the
standard 2-bit iPod screen (using an unchangeable palette) and the
16-bit iPod photo. The patch is attached, against version 1.2.8.

I’ve been working on a port of SDL to iPodLinux
(http://www.ipodlinux.org). I’ve created a patch for both the
standard 2-bit iPod screen (using an unchangeable palette) and the
16-bit iPod photo. The patch is attached, against version 1.2.8.

Cool!

So when’re we gonna see iVectoroids or iSuperTux? :wink:

When someone ports it! :stuck_out_tongue:
http://www.ipodlinux.org/SDL_Programming – iPod-specific SDL notes
http://www.ipodlinux.org/Building_SDL – building SDL for the iPod
– JoshOn 6/20/05, Bill Kendrick wrote:

On Sun, Jun 19, 2005 at 03:53:22PM -0700, Joshua Oreman wrote:

-bill!

I’ve been working on a port of SDL to iPodLinux
(http://www.ipodlinux.org). I’ve created a patch for both the
standard 2-bit iPod screen (using an unchangeable palette) and the
16-bit iPod photo. The patch is attached, against version 1.2.8.

Very cool! Could you create a README.iPodLinux to go along with it?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sure.
–snip–On 8/20/05, Sam Lantinga wrote:

I’ve been working on a port of SDL to iPodLinux
(http://www.ipodlinux.org). I’ve created a patch for both the
standard 2-bit iPod screen (using an unchangeable palette) and the
16-bit iPod photo. The patch is attached, against version 1.2.8.

Very cool! Could you create a README.iPodLinux to go along with it?

=======================================
iPod Patch for Simple DirectMedia Layer

Author: Joshua Oreman <@Joshua_Oreman>

This is a patch against SDL 1.2.8 for the iPod framebuffer, both
black-and-white and color. It has been tested with a black-and-white
iPod, since that’s all I have. Anyone with an iPod photo or color,
feel free to test it and report any bugs to me.

Building

In order to build this library for the iPod, you’ll need the arm-elf toolchain.

If you checked out the SDL source from CVS, run
% autogen.sh
to update all build files.

To build SDL for iPod:
% ./configure CFLAGS="-D__unix__" --host=arm-elf LDFLAGS=-Wl,-elf2flt
–enable-ipod
–disable-joystick --disable-cdrom --disable-video-opengl
% make
Copy the library at src/.libs/libSDL.a somewhere easily accessible.
Link against it by specifying its path as an argument to the linker,
or copy it to /usr/local/arm-elf/lib and use -lSDL.

Quirks

BPP. On monochrome iPods, call SDL_SetVideoMode() with bpp as 8.
(Not 2!) You can use SDL_ListModes() as normal to determine what kind
of iPod you’re running on.

2-Bit Palette. For various reasons, 2-bit color is represented as an
unchangeable 8-bit palette with [0]=white, [1]=light grey, [2]=dark
grey, [3]=black, [4]=white, … . If you want to apply this palette
to surfaces you create, you should know that light grey is RGB
160/160/160 and dark grey is RGB 80/80/80.

The mouse will be shown, though there’s not much you can do with it,
so you probably want to SDL_HideMouse().

Events. You’ll only ever receive SDL_KEYUP and SDL_KEYDOWN events. They are:
SDLK_r = scroll right
SDLK_l = scroll left
SDLK_m = Menu
SDLK_w = Rewind/Previous
SDLK_f = FFwd/Next
SDLK_d = Play/Pause
Scroll events are 96 to a rotation.


Much more information is available at
http://www.ipodlinux.org/Building_SDL and
http://www.ipodlinux.org/SDL_Programming, including some sample code.
Enjoy.
–snip–

Is there a possibility of this patch getting into 1.2.9?

– Josh

Is there a possibility of this patch getting into 1.2.9?

No, we’re wrapping up 1.2.9 right now, and this is large enough that I’d
want a bit of exposure for it before putting it in an official release.

-Sam Lantinga, Software Engineer, Blizzard Entertainment

HI People!

I tried to change the screen resolution in my application (compiled
under MacOS X), and … it crashes!
Well, I’m still a newbie, but the guilty code is that :

[…]
int CSubsystem::InitScreen (bool FullScreen) {
if (Initialized && !Locked) {
if (FullScreen) Screen = SDL_SetVideoMode(ResX, ResY, Bpp,
SDL_HWSURFACE|SDL_FULLSCREEN|SDL_RESIZABLE);
else Screen = SDL_SetVideoMode(ResX, ResY, Bpp, SDL_HWSURFACE|
SDL_RESIZABLE);
if (!Screen) return 1;
} else return 1;
return 0;
}
[…]
int CSubsystem::ResizeScreen (unsigned int ResX, unsigned int ResY,
unsigned int Bpp, bool FullScreen) {
if (Initialized && !Locked) {
this->ResX = ResX;
this->ResY = ResY;
this->Bpp = Bpp;
if (InitScreen(FullScreen) > 0) return 1;
} else return 1;
return 0;
}
[…]
if (Screen.InitScreen(false) > 0) return 1;
<do something here … >
if (Screen.GetSizeX() < 1024) if (Screen.ResizeScreen(1024, 768, 32,
false) > 0) return 1;
[…]

When changing resolution, the window frame changes its size but
doesn’t show any content and the program freezes.
I can’t find errors :frowning:

Any ideas ?
Bye, and Thanks again for your patience :stuck_out_tongue:

Andrea “mad Psycho” Nardinocchi --------- www.psychogames.net ---------

Andrea ‘Psycho’ Nardinocchi wrote:

I tried to change the screen resolution in my application (compiled
under MacOS X), and … it crashes!

if (FullScreen) Screen = SDL_SetVideoMode(ResX, ResY, Bpp, SDL_HWSURFACE|SDL_FULLSCREEN|SDL_RESIZABLE);

I’m not sure if that’s the cause of your crash, but SDL_FULLSCREEN and
SDL_RESIZABLE are mutually exclusive (check the documentation:
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSetVideoMode). I’ve never
seen a resizable screen. :slight_smile:

By the way, I recommend starting a new thread for a new topic instead of
replying in a completely unrelated old thread about the iPod video
driver. Otherwise, many people will never even see your message.

-Christian