Commit ecbe9ec6 authored by Ryan C. Gordon's avatar Ryan C. Gordon

iPod Linux framebuffer support.

--ryan.


Date: Sun, 19 Jun 2005 15:53:22 -0700
From: Joshua Oreman <oremanj@gmail.com>
To: sdl@libsdl.org
Subject: [SDL] [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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401143
parent 45d84e23
...@@ -549,6 +549,20 @@ CheckNASM() ...@@ -549,6 +549,20 @@ CheckNASM()
fi fi
} }
dnl Do the iPod thing
CheckIPod()
{
AC_ARG_ENABLE(ipod,
[ --enable-ipod configure SDL to work with iPodLinux [default=yes on arm-elf]],
, enable_ipod=yes)
if test x$enable_ipod = xyes; then
CFLAGS="$CFLAGS -DENABLE_IPOD -DIPOD"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS ipod"
VIDEO_DRIVERS="$VIDEO_DRIVERS ipod/libvideo_ipod.la"
fi
}
dnl Find the nanox include and library directories dnl Find the nanox include and library directories
CheckNANOX() CheckNANOX()
{ {
...@@ -1306,7 +1320,7 @@ CheckPTHREAD() ...@@ -1306,7 +1320,7 @@ CheckPTHREAD()
pthread_lib="-lpthread" pthread_lib="-lpthread"
;; ;;
esac esac
if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
# Save the original compiler flags and libraries # Save the original compiler flags and libraries
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
# Add the pthread compiler flags and libraries # Add the pthread compiler flags and libraries
...@@ -1932,6 +1946,15 @@ CheckRPATH() ...@@ -1932,6 +1946,15 @@ CheckRPATH()
} }
case "$target" in case "$target" in
arm-*-elf*)
ARCH=linux
CheckDummyVideo
CheckIPod
# Set up files for the timer library
if test x$enable_timers = xyes; then
COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
fi
;;
*-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu) *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
case "$target" in case "$target" in
*-*-linux*) ARCH=linux ;; *-*-linux*) ARCH=linux ;;
...@@ -2810,6 +2833,7 @@ AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos) ...@@ -2810,6 +2833,7 @@ AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx) AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx) AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint) AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
AM_CONDITIONAL(TARGET_IPOD, test x$enable_ipod = xyes)
# More automake conditionals # More automake conditionals
AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes) AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
...@@ -2989,6 +3013,7 @@ src/video/epoc/Makefile ...@@ -2989,6 +3013,7 @@ src/video/epoc/Makefile
src/video/fbcon/Makefile src/video/fbcon/Makefile
src/video/gem/Makefile src/video/gem/Makefile
src/video/ggi/Makefile src/video/ggi/Makefile
src/video/ipod/Makefile
src/video/maccommon/Makefile src/video/maccommon/Makefile
src/video/macdsp/Makefile src/video/macdsp/Makefile
src/video/macrom/Makefile src/video/macrom/Makefile
......
...@@ -181,7 +181,9 @@ static void SDL_StopEventThread(void) ...@@ -181,7 +181,9 @@ static void SDL_StopEventThread(void)
SDL_EventThread = NULL; SDL_EventThread = NULL;
SDL_DestroyMutex(SDL_EventLock.lock); SDL_DestroyMutex(SDL_EventLock.lock);
} }
#ifndef IPOD
SDL_DestroyMutex(SDL_EventQ.lock); SDL_DestroyMutex(SDL_EventQ.lock);
#endif
} }
Uint32 SDL_EventThreadID(void) Uint32 SDL_EventThreadID(void)
......
...@@ -37,6 +37,10 @@ static char rcsid = ...@@ -37,6 +37,10 @@ static char rcsid =
#define CANT_THREAD_EVENTS #define CANT_THREAD_EVENTS
#endif #endif
#ifdef IPOD /* iPod doesn't support threading at all */
#define CANT_THREAD_EVENTS
#endif
#ifdef macintosh /* MacOS 7/8 don't support preemptive multi-tasking */ #ifdef macintosh /* MacOS 7/8 don't support preemptive multi-tasking */
#define CANT_THREAD_EVENTS #define CANT_THREAD_EVENTS
#endif #endif
...@@ -74,7 +74,9 @@ void SDL_CursorQuit(void) ...@@ -74,7 +74,9 @@ void SDL_CursorQuit(void)
int SDL_CursorInit(Uint32 multithreaded) int SDL_CursorInit(Uint32 multithreaded)
{ {
/* We don't have mouse focus, and the cursor isn't drawn yet */ /* We don't have mouse focus, and the cursor isn't drawn yet */
#ifndef IPOD
SDL_cursorstate = CURSOR_VISIBLE; SDL_cursorstate = CURSOR_VISIBLE;
#endif
/* Create the default cursor */ /* Create the default cursor */
if ( SDL_defcursor == NULL ) { if ( SDL_defcursor == NULL ) {
......
...@@ -341,6 +341,9 @@ extern VideoBootStrap DGA_bootstrap; ...@@ -341,6 +341,9 @@ extern VideoBootStrap DGA_bootstrap;
#ifdef ENABLE_NANOX #ifdef ENABLE_NANOX
extern VideoBootStrap NX_bootstrap; extern VideoBootStrap NX_bootstrap;
#endif #endif
#ifdef ENABLE_IPOD
extern VideoBootStrap iPod_bootstrap;
#endif
#ifdef ENABLE_FBCON #ifdef ENABLE_FBCON
extern VideoBootStrap FBCON_bootstrap; extern VideoBootStrap FBCON_bootstrap;
#endif #endif
......
...@@ -57,6 +57,9 @@ static VideoBootStrap *bootstrap[] = { ...@@ -57,6 +57,9 @@ static VideoBootStrap *bootstrap[] = {
#ifdef ENABLE_NANOX #ifdef ENABLE_NANOX
&NX_bootstrap, &NX_bootstrap,
#endif #endif
#ifdef ENABLE_IPOD
&iPod_bootstrap,
#endif
#ifdef ENABLE_QTOPIA #ifdef ENABLE_QTOPIA
&Qtopia_bootstrap, &Qtopia_bootstrap,
#endif #endif
......
## Makefile.am for SDL using the iPod framebuffer driver
noinst_LTLIBRARIES = libvideo_ipod.la
libvideo_ipod_la_SOURCES = SDL_ipodvideo.c SDL_ipodvideo.h
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
/* iPod SDL framebuffer driver
* Joshua Oreman
* Main header file
*/
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id$";
#endif
#ifndef _SDL_ipodvideo_h
#define _SDL_ipodvideo_h
struct SDL_PrivateVideoData {
char *buffer;
int w, h;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment