Skip to content

Commit

Permalink
iPod Linux framebuffer support.
Browse files Browse the repository at this point in the history
--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
  • Loading branch information
icculus committed Sep 8, 2005
1 parent c53b300 commit 66374fe
Show file tree
Hide file tree
Showing 9 changed files with 797 additions and 1 deletion.
27 changes: 26 additions & 1 deletion configure.in
Expand Up @@ -549,6 +549,20 @@ CheckNASM()
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
CheckNANOX()
{
Expand Down Expand Up @@ -1306,7 +1320,7 @@ CheckPTHREAD()
pthread_lib="-lpthread"
;;
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
ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
# Add the pthread compiler flags and libraries
Expand Down Expand Up @@ -1932,6 +1946,15 @@ CheckRPATH()
}

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)
case "$target" in
*-*-linux*) ARCH=linux ;;
Expand Down Expand Up @@ -2810,6 +2833,7 @@ AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
AM_CONDITIONAL(TARGET_IPOD, test x$enable_ipod = xyes)

# More automake conditionals
AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
Expand Down Expand Up @@ -2989,6 +3013,7 @@ src/video/epoc/Makefile
src/video/fbcon/Makefile
src/video/gem/Makefile
src/video/ggi/Makefile
src/video/ipod/Makefile
src/video/maccommon/Makefile
src/video/macdsp/Makefile
src/video/macrom/Makefile
Expand Down
2 changes: 2 additions & 0 deletions src/events/SDL_events.c
Expand Up @@ -181,7 +181,9 @@ static void SDL_StopEventThread(void)
SDL_EventThread = NULL;
SDL_DestroyMutex(SDL_EventLock.lock);
}
#ifndef IPOD
SDL_DestroyMutex(SDL_EventQ.lock);
#endif
}

Uint32 SDL_EventThreadID(void)
Expand Down
4 changes: 4 additions & 0 deletions src/events/SDL_sysevents.h
Expand Up @@ -37,6 +37,10 @@ static char rcsid =
#define CANT_THREAD_EVENTS
#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 */
#define CANT_THREAD_EVENTS
#endif
2 changes: 2 additions & 0 deletions src/video/SDL_cursor.c
Expand Up @@ -74,7 +74,9 @@ void SDL_CursorQuit(void)
int SDL_CursorInit(Uint32 multithreaded)
{
/* We don't have mouse focus, and the cursor isn't drawn yet */
#ifndef IPOD
SDL_cursorstate = CURSOR_VISIBLE;
#endif

/* Create the default cursor */
if ( SDL_defcursor == NULL ) {
Expand Down
3 changes: 3 additions & 0 deletions src/video/SDL_sysvideo.h
Expand Up @@ -341,6 +341,9 @@ extern VideoBootStrap DGA_bootstrap;
#ifdef ENABLE_NANOX
extern VideoBootStrap NX_bootstrap;
#endif
#ifdef ENABLE_IPOD
extern VideoBootStrap iPod_bootstrap;
#endif
#ifdef ENABLE_FBCON
extern VideoBootStrap FBCON_bootstrap;
#endif
Expand Down
3 changes: 3 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -57,6 +57,9 @@ static VideoBootStrap *bootstrap[] = {
#ifdef ENABLE_NANOX
&NX_bootstrap,
#endif
#ifdef ENABLE_IPOD
&iPod_bootstrap,
#endif
#ifdef ENABLE_QTOPIA
&Qtopia_bootstrap,
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/video/ipod/Makefile.am
@@ -0,0 +1,5 @@

## Makefile.am for SDL using the iPod framebuffer driver

noinst_LTLIBRARIES = libvideo_ipod.la
libvideo_ipod_la_SOURCES = SDL_ipodvideo.c SDL_ipodvideo.h

0 comments on commit 66374fe

Please sign in to comment.