Clean up. gsoc2008_nds
authorDarren Alton <dalton@stevens.edu>
Wed, 27 Aug 2008 04:23:38 +0000
branchgsoc2008_nds
changeset 2698e1da92da346c
parent 2697 c9121b04cffa
child 2699 cf95a2fd3606
Clean up.
Makefile.ds
include/SDL_endian.h
src/SDL_compat.c
src/SDL_error.c
src/audio/SDL_audio.c
src/audio/alsa/SDL_alsa_audio.c
src/audio/dart/SDL_dart.c
src/audio/nds/SDL_ndsaudio.c
src/audio/nds/SDL_ndsaudio.h
src/audio/windib/SDL_dibaudio.c
src/audio/windx5/SDL_dx5audio.c
src/cdrom/SDL_cdrom.c
src/cdrom/macosx/AudioFileReaderThread.c
src/events/SDL_events.c
src/events/default_cursor.h
src/file/SDL_rwops.c
src/joystick/darwin/SDL_sysjoystick.c
src/joystick/linux/SDL_sysjoystick.c
src/joystick/nds/SDL_sysjoystick.c
src/joystick/win32/SDL_dxjoystick.c
src/loadso/macosx/SDL_dlcompat.c
src/stdlib/SDL_stdlib.c
src/thread/irix/SDL_syssem.c
src/timer/nds/SDL_systimer.c
src/video/SDL_blit_0.c
src/video/SDL_blit_1.c
src/video/SDL_blit_A.c
src/video/SDL_blit_N.c
src/video/SDL_gamma.c
src/video/SDL_pixels.c
src/video/SDL_renderer_sw.c
src/video/SDL_surface.c
src/video/ataricommon/SDL_atarigl.c
src/video/bwindow/SDL_sysvideo.cc
src/video/dc/SDL_dcevents.c
src/video/dc/SDL_dcvideo.c
src/video/directfb/SDL_DirectFB_events.c
src/video/directfb/SDL_DirectFB_mouse.c
src/video/directfb/SDL_DirectFB_render.c
src/video/directfb/SDL_DirectFB_video.c
src/video/fbcon/SDL_fb3dfx.c
src/video/fbcon/SDL_fbevents.c
src/video/fbcon/SDL_fbmatrox.c
src/video/fbcon/SDL_fbriva.c
src/video/fbcon/SDL_fbvideo.c
src/video/gapi/SDL_gapivideo.c
src/video/ipod/SDL_ipodvideo.c
src/video/nds/SDL_ndsevents.c
src/video/nds/SDL_ndsrender.c
src/video/nds/SDL_ndsvideo.c
src/video/os2fslib/SDL_os2fslib.c
src/video/photon/SDL_ph_gl.c
src/video/photon/SDL_ph_image.c
src/video/photon/SDL_phyuv.c
src/video/ps2gs/SDL_gsvideo.c
src/video/riscos/SDL_riscosvideo.c
src/video/svga/SDL_svgavideo.c
src/video/vgl/SDL_vglvideo.c
src/video/win32/SDL_d3drender.c
src/video/win32/SDL_gdirender.c
src/video/win32/SDL_win32keyboard.c
src/video/win32/SDL_win32opengl.c
src/video/wscons/SDL_wsconsvideo.c
src/video/x11/SDL_x11opengl.c
src/video/xbios/SDL_xbiosmodes.c
test/nds-test-progs/general/source/main.c
test/nds-test-progs/sprite/source/testsprite.c
test/nds-test-progs/sprite2/source/testsprite2.c
     1.1 --- a/Makefile.ds	Thu Aug 21 12:38:21 2008 +0000
     1.2 +++ b/Makefile.ds	Wed Aug 27 04:23:38 2008 +0000
     1.3 @@ -101,31 +101,10 @@
     1.4  OBJS = $(SRCS:.c=.o)
     1.5  
     1.6  TEST = \
     1.7 -	test/checkkeys.c \
     1.8 -	test/graywin.c \
     1.9 -	test/loopwave.c \
    1.10 -	test/testalpha.c \
    1.11 -	test/testbitmap.c \
    1.12 -	test/testcdrom.c \
    1.13 -	test/testerror.c \
    1.14 -	test/testgamma.c \
    1.15 -	test/testgl.c \
    1.16 -	test/testhread.c \
    1.17 -	test/testjoystick.c \
    1.18 -	test/testkeys.c \
    1.19 -	test/testlock.c \
    1.20 -	test/testoverlay.c \
    1.21 -	test/testpalette.c \
    1.22 -	test/testsem.c \
    1.23 -	test/testsprite.c \
    1.24 -	test/testtimer.c \
    1.25 -	test/testtypes.c \
    1.26 -	test/testver.c \
    1.27 -	test/testvidinfo.c \
    1.28 -	test/testwin.c \
    1.29 -	test/testwm.c \
    1.30 -	test/threadwin.c \
    1.31 -	test/torturethread.c \
    1.32 +test/nds-test-progs/general/general.nds \
    1.33 +test/nds-test-progs/sprite/sprite.nds \
    1.34 +test/nds-test-progs/sprite2/sprite2.nds \
    1.35 +
    1.36  
    1.37  all: $(TARGET)
    1.38  
    1.39 @@ -139,6 +118,9 @@
    1.40  	@mkdir -p $(DEVKITPRO)/libnds/include/SDL/
    1.41  	@cp include/*.h $(DEVKITPRO)/libnds/include/SDL/
    1.42  
    1.43 +nds_test:
    1.44 +	$(MAKE) -C test/nds-test-progs
    1.45 +
    1.46  copy_config:
    1.47  	@cp include/SDL_config.h.default include/SDL_config.h
    1.48  
     2.1 --- a/include/SDL_endian.h	Thu Aug 21 12:38:21 2008 +0000
     2.2 +++ b/include/SDL_endian.h	Wed Aug 27 04:23:38 2008 +0000
     2.3 @@ -156,8 +156,8 @@
     2.4      } v;
     2.5      v.u = x;
     2.6    __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
     2.7 -            "1"(v.s.
     2.8 -                b));
     2.9 +            "1"(v.
    2.10 +                s.b));
    2.11      return v.u;
    2.12  }
    2.13  #elif defined(__GNUC__) && defined(__x86_64__)
     3.1 --- a/src/SDL_compat.c	Thu Aug 21 12:38:21 2008 +0000
     3.2 +++ b/src/SDL_compat.c	Wed Aug 27 04:23:38 2008 +0000
     3.3 @@ -693,6 +693,7 @@
     3.4          SDL_UpdateRects(screen, 1, &rect);
     3.5      }
     3.6  }
     3.7 +
     3.8  void
     3.9  SDL_UpdateRects(SDL_Surface * screen, int numrects, SDL_Rect * rects)
    3.10  {
     4.1 --- a/src/SDL_error.c	Thu Aug 21 12:38:21 2008 +0000
     4.2 +++ b/src/SDL_error.c	Wed Aug 27 04:23:38 2008 +0000
     4.3 @@ -180,8 +180,8 @@
     4.4                  case 's':
     4.5                      len =
     4.6                          SDL_snprintf(msg, maxlen, tmp,
     4.7 -                                     SDL_LookupString(error->
     4.8 -                                                      args[argi++].buf));
     4.9 +                                     SDL_LookupString(error->args[argi++].
    4.10 +                                                      buf));
    4.11                      msg += len;
    4.12                      maxlen -= len;
    4.13                      break;
     5.1 --- a/src/audio/SDL_audio.c	Thu Aug 21 12:38:21 2008 +0000
     5.2 +++ b/src/audio/SDL_audio.c	Wed Aug 27 04:23:38 2008 +0000
     5.3 @@ -171,31 +171,38 @@
     5.4  {
     5.5      return -1;
     5.6  }
     5.7 +
     5.8  static void
     5.9  SDL_AudioThreadInit_Default(_THIS)
    5.10  {                               /* no-op. */
    5.11  }
    5.12 +
    5.13  static void
    5.14  SDL_AudioWaitDevice_Default(_THIS)
    5.15  {                               /* no-op. */
    5.16  }
    5.17 +
    5.18  static void
    5.19  SDL_AudioPlayDevice_Default(_THIS)
    5.20  {                               /* no-op. */
    5.21  }
    5.22 +
    5.23  static Uint8 *
    5.24  SDL_AudioGetDeviceBuf_Default(_THIS)
    5.25  {
    5.26      return NULL;
    5.27  }
    5.28 +
    5.29  static void
    5.30  SDL_AudioWaitDone_Default(_THIS)
    5.31  {                               /* no-op. */
    5.32  }
    5.33 +
    5.34  static void
    5.35  SDL_AudioCloseDevice_Default(_THIS)
    5.36  {                               /* no-op. */
    5.37  }
    5.38 +
    5.39  static void
    5.40  SDL_AudioDeinitialize_Default(void)
    5.41  {                               /* no-op. */
     6.1 --- a/src/audio/alsa/SDL_alsa_audio.c	Thu Aug 21 12:38:21 2008 +0000
     6.2 +++ b/src/audio/alsa/SDL_alsa_audio.c	Wed Aug 27 04:23:38 2008 +0000
     6.3 @@ -259,16 +259,19 @@
     6.4  {
     6.5      SWIZ6(Uint64);
     6.6  }
     6.7 +
     6.8  static __inline__ void
     6.9  swizzle_alsa_channels_6_32bit(_THIS)
    6.10  {
    6.11      SWIZ6(Uint32);
    6.12  }
    6.13 +
    6.14  static __inline__ void
    6.15  swizzle_alsa_channels_6_16bit(_THIS)
    6.16  {
    6.17      SWIZ6(Uint16);
    6.18  }
    6.19 +
    6.20  static __inline__ void
    6.21  swizzle_alsa_channels_6_8bit(_THIS)
    6.22  {
     7.1 --- a/src/audio/dart/SDL_dart.c	Thu Aug 21 12:38:21 2008 +0000
     7.2 +++ b/src/audio/dart/SDL_dart.c	Wed Aug 27 04:23:38 2008 +0000
     7.3 @@ -62,8 +62,8 @@
     7.4                  pBufDesc->iBufferUsage = BUFFER_EMPTY;
     7.5                  // And notify DART feeder thread that it will have to work a bit.
     7.6                  if (pSDLAudioDevice)
     7.7 -                    DosPostEventSem(pSDLAudioDevice->hidden->
     7.8 -                                    hevAudioBufferPlayed);
     7.9 +                    DosPostEventSem(pSDLAudioDevice->
    7.10 +                                    hidden->hevAudioBufferPlayed);
    7.11              }
    7.12          }
    7.13      }
    7.14 @@ -312,10 +312,11 @@
    7.15          (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm;
    7.16      pBufDesc->iBufferUsage = BUFFER_USED;
    7.17      // Send it to DART to be queued
    7.18 -    _this->hidden->MixSetupParms.pmixWrite(_this->hidden->MixSetupParms.
    7.19 -                                           ulMixHandle,
    7.20 -                                           &(_this->hidden->
    7.21 -                                             pMixBuffers[iFreeBuf]), 1);
    7.22 +    _this->hidden->MixSetupParms.pmixWrite(_this->hidden->
    7.23 +                                           MixSetupParms.ulMixHandle,
    7.24 +                                           &(_this->
    7.25 +                                             hidden->pMixBuffers[iFreeBuf]),
    7.26 +                                           1);
    7.27  
    7.28      _this->hidden->iLastPlayedBuf = iFreeBuf;
    7.29      iFreeBuf = (iFreeBuf + 1) % _this->hidden->iCurrNumBufs;
    7.30 @@ -333,8 +334,8 @@
    7.31          if (_this->hidden) {
    7.32              iFreeBuf = _this->hidden->iNextFreeBuffer;
    7.33              pBufDesc =
    7.34 -                (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].
    7.35 -                ulUserParm;
    7.36 +                (pMixBufferDesc) _this->hidden->
    7.37 +                pMixBuffers[iFreeBuf].ulUserParm;
    7.38  
    7.39              if (pBufDesc) {
    7.40                  if (pBufDesc->iBufferUsage == BUFFER_EMPTY) {
     8.1 --- a/src/audio/nds/SDL_ndsaudio.c	Thu Aug 21 12:38:21 2008 +0000
     8.2 +++ b/src/audio/nds/SDL_ndsaudio.c	Wed Aug 27 04:23:38 2008 +0000
     8.3 @@ -31,8 +31,6 @@
     8.4  #include "../SDL_audio_c.h"
     8.5  #include "SDL_ndsaudio.h"
     8.6  
     8.7 -#define TRACE printf
     8.8 -
     8.9  static int
    8.10  NDSAUD_OpenDevice(_THIS, const char *devname, int iscapture)
    8.11  {
    8.12 @@ -40,48 +38,44 @@
    8.13      int valid_datatype = 0;
    8.14  
    8.15      this->hidden = SDL_malloc(sizeof(*(this->hidden)));
    8.16 -    if(!this->hidden) {
    8.17 +    if (!this->hidden) {
    8.18          SDL_OutOfMemory();
    8.19          return 0;
    8.20      }
    8.21      SDL_memset(this->hidden, 0, (sizeof *this->hidden));
    8.22  
    8.23 -    TRACE("+NDSAUD_OpenDevice\n");
    8.24      while ((!valid_datatype) && (test_format)) {
    8.25          this->spec.format = test_format;
    8.26          switch (test_format) {
    8.27 -            case AUDIO_S8:
    8.28 -            /*case AUDIO_S16LSB:*/
    8.29 -                valid_datatype = 1;
    8.30 -                break;
    8.31 -            default:
    8.32 -               test_format = SDL_NextAudioFormat();
    8.33 -               break;
    8.34 +        case AUDIO_S8:
    8.35 +            /*case AUDIO_S16LSB: */
    8.36 +            valid_datatype = 1;
    8.37 +            break;
    8.38 +        default:
    8.39 +            test_format = SDL_NextAudioFormat();
    8.40 +            break;
    8.41          }
    8.42      }
    8.43  
    8.44      /* set the generic sound parameters */
    8.45 -    setGenericSound(22050,  /* sample rate */
    8.46 -                    127,    /* volume */
    8.47 -                    64,     /* panning/balance */
    8.48 -                    0);     /* sound format*/
    8.49 +    setGenericSound(22050,      /* sample rate */
    8.50 +                    127,        /* volume */
    8.51 +                    64,         /* panning/balance */
    8.52 +                    0);         /* sound format */
    8.53  
    8.54 -    TRACE("-NDSAUD_OpenDevice\n");
    8.55      return 1;
    8.56  }
    8.57  
    8.58  static void
    8.59  NDSAUD_PlayDevice(_THIS)
    8.60  {
    8.61 -    TransferSoundData* sound = SDL_malloc(sizeof(TransferSoundData));
    8.62 -    if(!sound) {
    8.63 +    TransferSoundData *sound = SDL_malloc(sizeof(TransferSoundData));
    8.64 +    if (!sound) {
    8.65          SDL_OutOfMemory();
    8.66      }
    8.67 -    TRACE("+NDSAUD_PlayDevice\n");
    8.68  
    8.69      playGenericSound(this->hidden->mixbuf, this->hidden->mixlen);
    8.70 -
    8.71 -    TRACE("-NDSAUD_PlayDevice\n");
    8.72 +#if 0
    8.73  //    sound->data = this->hidden->mixbuf;/* pointer to raw audio data */
    8.74  //    sound->len = this->hidden->mixlen; /* size of raw data pointed to above */
    8.75  //    sound->rate = 22050; /* sample rate = 22050Hz */
    8.76 @@ -89,35 +83,31 @@
    8.77  //    sound->pan = 64;     /* balance [0..127] for [left..right] */
    8.78  //    sound->format = 0;   /* 0 for 16-bit, 1 for 8-bit */
    8.79  //    playSound(sound);
    8.80 +#endif
    8.81  }
    8.82  
    8.83  
    8.84  static Uint8 *
    8.85  NDSAUD_GetDeviceBuf(_THIS)
    8.86 -{   /* is this right? */
    8.87 -    TRACE("!NDSAUD_GetDeviceBuf\n");
    8.88 -    return this->hidden->mixbuf;
    8.89 +{
    8.90 +    return this->hidden->mixbuf;        /* is this right? */
    8.91  }
    8.92  
    8.93  static void
    8.94  NDSAUD_WaitDevice(_THIS)
    8.95  {
    8.96      /* stub */
    8.97 -    TRACE("!NDSAUD_WaitDevice\n");
    8.98  }
    8.99  
   8.100  static void
   8.101  NDSAUD_CloseDevice(_THIS)
   8.102  {
   8.103      /* stub */
   8.104 -    TRACE("!NDSAUD_CloseDevice\n");
   8.105  }
   8.106  
   8.107  static int
   8.108  NDSAUD_Init(SDL_AudioDriverImpl * impl)
   8.109  {
   8.110 -    TRACE("+NDSAUD_Init\n");
   8.111 -
   8.112      /* Set the function pointers */
   8.113      impl->OpenDevice = NDSAUD_OpenDevice;
   8.114      impl->PlayDevice = NDSAUD_PlayDevice;
   8.115 @@ -130,12 +120,11 @@
   8.116      impl->OnlyHasDefaultOutputDevice = 1;
   8.117      impl->OnlyHasDefaultInputDevice = 1;
   8.118  
   8.119 -    TRACE("-NDSAUD_Init\n");
   8.120      return 1;
   8.121  }
   8.122  
   8.123  AudioBootStrap NDSAUD_bootstrap = {
   8.124 -    "nds", "SDL NDS audio driver", NDSAUD_Init, 0 /*1?*/
   8.125 +    "nds", "SDL NDS audio driver", NDSAUD_Init, 0       /*1? */
   8.126  };
   8.127  
   8.128  /* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/audio/nds/SDL_ndsaudio.h	Thu Aug 21 12:38:21 2008 +0000
     9.2 +++ b/src/audio/nds/SDL_ndsaudio.h	Wed Aug 27 04:23:38 2008 +0000
     9.3 @@ -32,7 +32,7 @@
     9.4  
     9.5  struct SDL_PrivateAudioData
     9.6  {
     9.7 -    TransferSoundData* sound;
     9.8 +    TransferSoundData *sound;
     9.9      /* The file descriptor for the audio device */
    9.10      Uint8 *mixbuf;
    9.11      Uint32 mixlen;
    10.1 --- a/src/audio/windib/SDL_dibaudio.c	Thu Aug 21 12:38:21 2008 +0000
    10.2 +++ b/src/audio/windib/SDL_dibaudio.c	Wed Aug 27 04:23:38 2008 +0000
    10.3 @@ -107,8 +107,8 @@
    10.4  Uint8 *
    10.5  WINWAVEOUT_GetDeviceBuf(_THIS)
    10.6  {
    10.7 -    return (Uint8 *) (this->hidden->wavebuf[this->hidden->next_buffer].
    10.8 -                      lpData);
    10.9 +    return (Uint8 *) (this->hidden->
   10.10 +                      wavebuf[this->hidden->next_buffer].lpData);
   10.11  }
   10.12  
   10.13  void
    11.1 --- a/src/audio/windx5/SDL_dx5audio.c	Thu Aug 21 12:38:21 2008 +0000
    11.2 +++ b/src/audio/windx5/SDL_dx5audio.c	Wed Aug 27 04:23:38 2008 +0000
    11.3 @@ -278,8 +278,9 @@
    11.4          IDirectSoundBuffer_Restore(this->hidden->mixbuf);
    11.5          result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor,
    11.6                                           this->hidden->mixlen,
    11.7 -                                         (LPVOID *) & this->hidden->
    11.8 -                                         locked_buf, &rawlen, NULL, &junk, 0);
    11.9 +                                         (LPVOID *) & this->
   11.10 +                                         hidden->locked_buf, &rawlen, NULL,
   11.11 +                                         &junk, 0);
   11.12      }
   11.13      if (result != DS_OK) {
   11.14          SetDSerror("DirectSound Lock", result);
    12.1 --- a/src/cdrom/SDL_cdrom.c	Thu Aug 21 12:38:21 2008 +0000
    12.2 +++ b/src/cdrom/SDL_cdrom.c	Wed Aug 27 04:23:38 2008 +0000
    12.3 @@ -44,6 +44,7 @@
    12.4      NULL,                       /* Eject */
    12.5      NULL,                       /* Close */
    12.6  };
    12.7 +
    12.8  int SDL_numcds;
    12.9  
   12.10  int
    13.1 --- a/src/cdrom/macosx/AudioFileReaderThread.c	Thu Aug 21 12:38:21 2008 +0000
    13.2 +++ b/src/cdrom/macosx/AudioFileReaderThread.c	Wed Aug 27 04:23:38 2008 +0000
    13.3 @@ -335,9 +335,8 @@
    13.4          }
    13.5          /* construct pointer */
    13.6          char *writePtr = (char *) (theItem->GetFileBuffer(theItem) +
    13.7 -                                   (theItem->
    13.8 -                                    mWriteToFirstBuffer ? 0 : theItem->
    13.9 -                                    mChunkSize));
   13.10 +                                   (theItem->mWriteToFirstBuffer ? 0 :
   13.11 +                                    theItem->mChunkSize));
   13.12  
   13.13          /* read data */
   13.14          result = theItem->Read(theItem, writePtr, &dataChunkSize);
   13.15 @@ -486,8 +485,7 @@
   13.16      } else {
   13.17          *inOutDataSize = afm->mChunkSize;
   13.18          *inOutData =
   13.19 -            afm->mReadFromFirstBuffer ? afm->mFileBuffer : (afm->
   13.20 -                                                            mFileBuffer +
   13.21 +            afm->mReadFromFirstBuffer ? afm->mFileBuffer : (afm->mFileBuffer +
   13.22                                                              afm->mChunkSize);
   13.23      }
   13.24  
    14.1 --- a/src/events/SDL_events.c	Thu Aug 21 12:38:21 2008 +0000
    14.2 +++ b/src/events/SDL_events.c	Wed Aug 27 04:23:38 2008 +0000
    14.3 @@ -73,6 +73,7 @@
    14.4          }
    14.5      }
    14.6  }
    14.7 +
    14.8  void
    14.9  SDL_Unlock_EventThread(void)
   14.10  {
    15.1 --- a/src/events/default_cursor.h	Thu Aug 21 12:38:21 2008 +0000
    15.2 +++ b/src/events/default_cursor.h	Wed Aug 27 04:23:38 2008 +0000
    15.3 @@ -51,6 +51,7 @@
    15.4      0x03, 0x00,
    15.5      0x00, 0x00
    15.6  };
    15.7 +
    15.8  static unsigned char default_cmask[] = {
    15.9      0xC0, 0x00,
   15.10      0xE0, 0x00,
   15.11 @@ -90,6 +91,7 @@
   15.12      0x03, 0x00,
   15.13      0x00, 0x00
   15.14  };
   15.15 +
   15.16  static unsigned char default_cmask[] = {
   15.17      0x40, 0x00,
   15.18      0xE0, 0x00,
    16.1 --- a/src/file/SDL_rwops.c	Thu Aug 21 12:38:21 2008 +0000
    16.2 +++ b/src/file/SDL_rwops.c	Wed Aug 27 04:23:38 2008 +0000
    16.3 @@ -136,6 +136,7 @@
    16.4  
    16.5      return 0;                   /* ok */
    16.6  }
    16.7 +
    16.8  static long SDLCALL
    16.9  win32_file_seek(SDL_RWops * context, long offset, int whence)
   16.10  {
   16.11 @@ -177,6 +178,7 @@
   16.12      SDL_Error(SDL_EFSEEK);
   16.13      return -1;                  /* error */
   16.14  }
   16.15 +
   16.16  static size_t SDLCALL
   16.17  win32_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
   16.18  {
   16.19 @@ -230,6 +232,7 @@
   16.20      }
   16.21      return (total_read / size);
   16.22  }
   16.23 +
   16.24  static size_t SDLCALL
   16.25  win32_file_write(SDL_RWops * context, const void *ptr, size_t size,
   16.26                   size_t num)
   16.27 @@ -269,6 +272,7 @@
   16.28      nwritten = byte_written / size;
   16.29      return nwritten;
   16.30  }
   16.31 +
   16.32  static int SDLCALL
   16.33  win32_file_close(SDL_RWops * context)
   16.34  {
   16.35 @@ -302,6 +306,7 @@
   16.36          return (-1);
   16.37      }
   16.38  }
   16.39 +
   16.40  static size_t SDLCALL
   16.41  stdio_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
   16.42  {
   16.43 @@ -313,6 +318,7 @@
   16.44      }
   16.45      return (nread);
   16.46  }
   16.47 +
   16.48  static size_t SDLCALL
   16.49  stdio_write(SDL_RWops * context, const void *ptr, size_t size, size_t num)
   16.50  {
   16.51 @@ -324,6 +330,7 @@
   16.52      }
   16.53      return (nwrote);
   16.54  }
   16.55 +
   16.56  static int SDLCALL
   16.57  stdio_close(SDL_RWops * context)
   16.58  {
   16.59 @@ -372,6 +379,7 @@
   16.60      context->hidden.mem.here = newpos;
   16.61      return (context->hidden.mem.here - context->hidden.mem.base);
   16.62  }
   16.63 +
   16.64  static size_t SDLCALL
   16.65  mem_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
   16.66  {
   16.67 @@ -394,6 +402,7 @@
   16.68  
   16.69      return (total_bytes / size);
   16.70  }
   16.71 +
   16.72  static size_t SDLCALL
   16.73  mem_write(SDL_RWops * context, const void *ptr, size_t size, size_t num)
   16.74  {
   16.75 @@ -404,12 +413,14 @@
   16.76      context->hidden.mem.here += num * size;
   16.77      return (num);
   16.78  }
   16.79 +
   16.80  static size_t SDLCALL
   16.81  mem_writeconst(SDL_RWops * context, const void *ptr, size_t size, size_t num)
   16.82  {
   16.83      SDL_SetError("Can't write to read-only memory");
   16.84      return (-1);
   16.85  }
   16.86 +
   16.87  static int SDLCALL
   16.88  mem_close(SDL_RWops * context)
   16.89  {
   16.90 @@ -467,9 +478,9 @@
   16.91  {
   16.92      SDL_RWops *rwops = NULL;
   16.93  #if 0
   16.94 -ifdef __NDS__
   16.95 -    /* set it up so we can use stdio file function */
   16.96 -    fatInitDefault();
   16.97 +    ifdef __NDS__
   16.98 +        /* set it up so we can use stdio file function */
   16.99 +      fatInitDefault();
  16.100      printf("called fatInitDefault()");
  16.101  #endif /* __NDS__ */
  16.102      rwops = SDL_AllocRW();
    17.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Thu Aug 21 12:38:21 2008 +0000
    17.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Wed Aug 27 04:23:38 2008 +0000
    17.3 @@ -194,8 +194,8 @@
    17.4                  (*ppPlugInInterface)->QueryInterface(ppPlugInInterface,
    17.5                                                       CFUUIDGetUUIDBytes
    17.6                                                       (kIOHIDDeviceInterfaceID),
    17.7 -                                                     (void *) &(pDevice->
    17.8 -                                                                interface));
    17.9 +                                                     (void *)
   17.10 +                                                     &(pDevice->interface));
   17.11              if (S_OK != plugInResult)
   17.12                  HIDReportErrorNum
   17.13                      ("CouldnŐt query HID class device interface from plugInInterface",
    18.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Thu Aug 21 12:38:21 2008 +0000
    18.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Wed Aug 27 04:23:38 2008 +0000
    18.3 @@ -91,6 +91,7 @@
    18.4  static struct joystick_logical_mapping mp88xx_1_logical_axismap[] = {
    18.5      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}
    18.6  };
    18.7 +
    18.8  static struct joystick_logical_mapping mp88xx_1_logical_buttonmap[] = {
    18.9      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8},
   18.10      {0, 9}, {0, 10}, {0, 11}
   18.11 @@ -100,6 +101,7 @@
   18.12      {0, 0}, {0, 1}, {0, 2}, {1, 0}, {1, 1}, {0, 3},
   18.13      {1, 2}, {1, 3}, {0, 4}, {0, 5}, {1, 4}, {1, 5}
   18.14  };
   18.15 +
   18.16  static struct joystick_logical_mapping mp88xx_2_logical_buttonmap[] = {
   18.17      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8},
   18.18      {0, 9}, {0, 10}, {0, 11},
   18.19 @@ -112,6 +114,7 @@
   18.20      {1, 2}, {1, 3}, {2, 0}, {2, 1}, {2, 2}, {2, 3},
   18.21      {0, 4}, {0, 5}, {1, 4}, {1, 5}, {2, 4}, {2, 5}
   18.22  };
   18.23 +
   18.24  static struct joystick_logical_mapping mp88xx_3_logical_buttonmap[] = {
   18.25      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8},
   18.26      {0, 9}, {0, 10}, {0, 11},
   18.27 @@ -127,6 +130,7 @@
   18.28      {3, 0}, {3, 1}, {3, 2}, {3, 3}, {0, 4}, {0, 5},
   18.29      {1, 4}, {1, 5}, {2, 4}, {2, 5}, {3, 4}, {3, 5}
   18.30  };
   18.31 +
   18.32  static struct joystick_logical_mapping mp88xx_4_logical_buttonmap[] = {
   18.33      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8},
   18.34      {0, 9}, {0, 10}, {0, 11},
   18.35 @@ -149,15 +153,18 @@
   18.36  static struct joystick_logical_layout mp88xx_1_logical_layout[] = {
   18.37      {6, 0, 0, 12}
   18.38  };
   18.39 +
   18.40  static struct joystick_logical_layout mp88xx_2_logical_layout[] = {
   18.41      {6, 0, 0, 12},
   18.42      {6, 0, 0, 12}
   18.43  };
   18.44 +
   18.45  static struct joystick_logical_layout mp88xx_3_logical_layout[] = {
   18.46      {6, 0, 0, 12},
   18.47      {6, 0, 0, 12},
   18.48      {6, 0, 0, 12}
   18.49  };
   18.50 +
   18.51  static struct joystick_logical_layout mp88xx_4_logical_layout[] = {
   18.52      {6, 0, 0, 12},
   18.53      {6, 0, 0, 12},
   18.54 @@ -979,8 +986,8 @@
   18.55  #endif /* USE_LOGICAL_JOYSTICKS */
   18.56  
   18.57          SDL_PrivateJoystickHat(stick, hat,
   18.58 -                               position_map[the_hat->axis[1]][the_hat->
   18.59 -                                                              axis[0]]);
   18.60 +                               position_map[the_hat->
   18.61 +                                            axis[1]][the_hat->axis[0]]);
   18.62      }
   18.63  }
   18.64  
   18.65 @@ -1111,13 +1118,13 @@
   18.66                      code -= BTN_MISC;
   18.67  #ifndef NO_LOGICAL_JOYSTICKS
   18.68                      if (!LogicalJoystickButton(joystick,
   18.69 -                                               joystick->hwdata->
   18.70 -                                               key_map[code],
   18.71 +                                               joystick->
   18.72 +                                               hwdata->key_map[code],
   18.73                                                 events[i].value))
   18.74  #endif
   18.75                          SDL_PrivateJoystickButton(joystick,
   18.76 -                                                  joystick->hwdata->
   18.77 -                                                  key_map[code],
   18.78 +                                                  joystick->
   18.79 +                                                  hwdata->key_map[code],
   18.80                                                    events[i].value);
   18.81                  }
   18.82                  break;
   18.83 @@ -1139,12 +1146,12 @@
   18.84                          EV_AxisCorrect(joystick, code, events[i].value);
   18.85  #ifndef NO_LOGICAL_JOYSTICKS
   18.86                      if (!LogicalJoystickAxis(joystick,
   18.87 -                                             joystick->hwdata->
   18.88 -                                             abs_map[code], events[i].value))
   18.89 +                                             joystick->hwdata->abs_map[code],
   18.90 +                                             events[i].value))
   18.91  #endif
   18.92                          SDL_PrivateJoystickAxis(joystick,
   18.93 -                                                joystick->hwdata->
   18.94 -                                                abs_map[code],
   18.95 +                                                joystick->
   18.96 +                                                hwdata->abs_map[code],
   18.97                                                  events[i].value);
   18.98                      break;
   18.99                  }
    19.1 --- a/src/joystick/nds/SDL_sysjoystick.c	Thu Aug 21 12:38:21 2008 +0000
    19.2 +++ b/src/joystick/nds/SDL_sysjoystick.c	Wed Aug 27 04:23:38 2008 +0000
    19.3 @@ -20,18 +20,12 @@
    19.4      slouken@devolution.com
    19.5  */
    19.6  
    19.7 -#ifdef SAVE_RCSID
    19.8 -static char rcsid =
    19.9 -    "@(#) $Id: SDL_sysjoystick.c,v 1.2 2001/04/26 16:50:17 hercules Exp $";
   19.10 -#endif
   19.11 -
   19.12  #include "SDL_config.h"
   19.13  
   19.14  #ifdef SDL_JOYSTICK_NDS
   19.15  
   19.16  /* This is the system specific header for the SDL joystick API */
   19.17  #include <nds.h>
   19.18 -//#include <nds/registers_alt.h>
   19.19  #include <stdio.h>              /* For the definition of NULL */
   19.20  
   19.21  #include "SDL_error.h"
   19.22 @@ -51,8 +45,7 @@
   19.23  SDL_SYS_JoystickInit(void)
   19.24  {
   19.25      SDL_numjoysticks = 1;
   19.26 -    /* keysInit();*/
   19.27 -    return (1);
   19.28 +    
   19.29 return (1);
   19.30  }
   19.31  
   19.32  /* Function to get the device-dependent name of a joystick */
   19.33 @@ -86,13 +79,14 @@
   19.34   * but instead should call SDL_PrivateJoystick*() to deliver events
   19.35   * and update joystick device state.
   19.36   */
   19.37 -void
   19.38 +    void
   19.39  SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
   19.40  {
   19.41      u32 keysd, keysu;
   19.42 -    int magnitude = 16384;
   19.43 -    /*scanKeys();*/
   19.44 -    keysd = keysDown();
   19.45 +    int magnitude = 16384;
   19.46 +    
   19.47 +        /*scanKeys(); */ 
   19.48 +        keysd = keysDown();
   19.49      keysu = keysUp();
   19.50  
   19.51      if ((keysd & KEY_UP)) {
   19.52 @@ -107,50 +101,61 @@
   19.53      if ((keysd & KEY_RIGHT)) {
   19.54          SDL_PrivateJoystickAxis(joystick, 0, magnitude);
   19.55      }
   19.56 -
   19.57     if ((keysu & (KEY_UP|KEY_DOWN))) {
   19.58 +    
   19.59 if ((keysu & (KEY_UP | KEY_DOWN))) {
   19.60          SDL_PrivateJoystickAxis(joystick, 1, 0);
   19.61 -    }
   19.62 -    if ((keysu & (KEY_LEFT|KEY_RIGHT))) {
   19.63 +    }
   19.64 +    
   19.65 if ((keysu & (KEY_LEFT | KEY_RIGHT))) {
   19.66          SDL_PrivateJoystickAxis(joystick, 0, 0);
   19.67      }
   19.68 -
   19.69     if ((keysd & KEY_A)) {
   19.70 +    
   19.71 if ((keysd & KEY_A)) {
   19.72          SDL_PrivateJoystickButton(joystick, 0, SDL_PRESSED);
   19.73 -    }
   19.74     if ((keysd & KEY_B)) {
   19.75 +    }
   19.76 +    
   19.77 if ((keysd & KEY_B)) {
   19.78          SDL_PrivateJoystickButton(joystick, 1, SDL_PRESSED);
   19.79 -    }
   19.80     if ((keysd & KEY_X)) {
   19.81 +    }
   19.82 +    
   19.83 if ((keysd & KEY_X)) {
   19.84          SDL_PrivateJoystickButton(joystick, 2, SDL_PRESSED);
   19.85 -    }
   19.86     if ((keysd & KEY_Y)) {
   19.87 +    }
   19.88 +    
   19.89 if ((keysd & KEY_Y)) {
   19.90          SDL_PrivateJoystickButton(joystick, 3, SDL_PRESSED);
   19.91      }
   19.92 -
   19.93     if ((keysd & KEY_L)) {
   19.94 +    
   19.95 if ((keysd & KEY_L)) {
   19.96          SDL_PrivateJoystickButton(joystick, 4, SDL_PRESSED);
   19.97 -    }
   19.98     if ((keysd & KEY_R)) {
   19.99 +    }
  19.100 +    
  19.101 if ((keysd & KEY_R)) {
  19.102          SDL_PrivateJoystickButton(joystick, 5, SDL_PRESSED);
  19.103      }
  19.104 -
  19.105     if ((keysd & KEY_SELECT)) {
  19.106 +    
  19.107 if ((keysd & KEY_SELECT)) {
  19.108          SDL_PrivateJoystickButton(joystick, 6, SDL_PRESSED);
  19.109 -    }
  19.110     if ((keysd & KEY_START)) {
  19.111 +    }
  19.112 +    
  19.113 if ((keysd & KEY_START)) {
  19.114          SDL_PrivateJoystickButton(joystick, 7, SDL_PRESSED);
  19.115      }
  19.116 -
  19.117     if ((keysu & KEY_A)) {
  19.118 +    
  19.119 if ((keysu & KEY_A)) {
  19.120          SDL_PrivateJoystickButton(joystick, 0, SDL_RELEASED);
  19.121 -    }
  19.122     if ((keysu & KEY_B)) {
  19.123 +    }
  19.124 +    
  19.125 if ((keysu & KEY_B)) {
  19.126          SDL_PrivateJoystickButton(joystick, 1, SDL_RELEASED);
  19.127 -    }
  19.128     if ((keysu & KEY_X)) {
  19.129 +    }
  19.130 +    
  19.131 if ((keysu & KEY_X)) {
  19.132          SDL_PrivateJoystickButton(joystick, 2, SDL_RELEASED);
  19.133 -    }
  19.134     if ((keysu & KEY_Y)) {
  19.135 +    }
  19.136 +    
  19.137 if ((keysu & KEY_Y)) {
  19.138          SDL_PrivateJoystickButton(joystick, 3, SDL_RELEASED);
  19.139      }
  19.140 -
  19.141     if ((keysu & KEY_L)) {
  19.142 +    
  19.143 if ((keysu & KEY_L)) {
  19.144          SDL_PrivateJoystickButton(joystick, 4, SDL_RELEASED);
  19.145 -    }
  19.146     if ((keysu & KEY_R)) {
  19.147 +    }
  19.148 +    
  19.149 if ((keysu & KEY_R)) {
  19.150          SDL_PrivateJoystickButton(joystick, 5, SDL_RELEASED);
  19.151      }
  19.152 -
  19.153     if ((keysu & KEY_SELECT)) {
  19.154 +    
  19.155 if ((keysu & KEY_SELECT)) {
  19.156          SDL_PrivateJoystickButton(joystick, 6, SDL_RELEASED);
  19.157 -    }
  19.158     if ((keysu & KEY_START)) {
  19.159 +    }
  19.160 +    
  19.161 if ((keysu & KEY_START)) {
  19.162          SDL_PrivateJoystickButton(joystick, 7, SDL_RELEASED);
  19.163 -    }
  19.164 }
  19.165 +    }
  19.166 +
  19.167 }
  19.168  
  19.169  /* Function to close a joystick after use */
  19.170  void
  19.171 @@ -163,5 +168,5 @@
  19.172  SDL_SYS_JoystickQuit(void)
  19.173  {
  19.174  }
  19.175 +
  19.176  #endif /* SDL_JOYSTICK_NDS */
  19.177 -
    20.1 --- a/src/joystick/win32/SDL_dxjoystick.c	Thu Aug 21 12:38:21 2008 +0000
    20.2 +++ b/src/joystick/win32/SDL_dxjoystick.c	Wed Aug 27 04:23:38 2008 +0000
    20.3 @@ -226,8 +226,8 @@
    20.4  
    20.5      result =
    20.6          IDirectInput_CreateDevice(dinput,
    20.7 -                                  &SYS_Joystick[joystick->index].
    20.8 -                                  guidInstance, &device, NULL);
    20.9 +                                  &SYS_Joystick[joystick->index].guidInstance,
   20.10 +                                  &device, NULL);
   20.11      if (FAILED(result)) {
   20.12          SetDIerror("IDirectInput::CreateDevice", result);
   20.13          return (-1);
   20.14 @@ -236,8 +236,8 @@
   20.15      /* Now get the IDirectInputDevice2 interface, instead. */
   20.16      result = IDirectInputDevice_QueryInterface(device,
   20.17                                                 &IID_IDirectInputDevice2,
   20.18 -                                               (LPVOID *) & joystick->
   20.19 -                                               hwdata->InputDevice);
   20.20 +                                               (LPVOID *) & joystick->hwdata->
   20.21 +                                               InputDevice);
   20.22      /* We are done with this object.  Use the stored one from now on. */
   20.23      IDirectInputDevice_Release(device);
   20.24  
   20.25 @@ -249,8 +249,8 @@
   20.26      /* Aquire shared access. Exclusive access is required for forces,
   20.27       * though. */
   20.28      result =
   20.29 -        IDirectInputDevice2_SetCooperativeLevel(joystick->hwdata->
   20.30 -                                                InputDevice, SDL_Window,
   20.31 +        IDirectInputDevice2_SetCooperativeLevel(joystick->hwdata->InputDevice,
   20.32 +                                                SDL_Window,
   20.33                                                  DISCL_EXCLUSIVE |
   20.34                                                  DISCL_BACKGROUND);
   20.35      if (FAILED(result)) {
   20.36 @@ -289,8 +289,8 @@
   20.37  
   20.38          /* reset all accuators. */
   20.39          result =
   20.40 -            IDirectInputDevice2_SendForceFeedbackCommand(joystick->hwdata->
   20.41 -                                                         InputDevice,
   20.42 +            IDirectInputDevice2_SendForceFeedbackCommand(joystick->
   20.43 +                                                         hwdata->InputDevice,
   20.44                                                           DISFFC_RESET);
   20.45  
   20.46          if (FAILED(result)) {
   20.47 @@ -481,9 +481,8 @@
   20.48  
   20.49          case BUTTON:
   20.50              SDL_PrivateJoystickButton_Int(joystick, in->num,
   20.51 -                                          (Uint8) (state.
   20.52 -                                                   rgbButtons[in->ofs -
   20.53 -                                                              DIJOFS_BUTTON0]
   20.54 +                                          (Uint8) (state.rgbButtons[in->ofs -
   20.55 +                                                                    DIJOFS_BUTTON0]
   20.56                                                     ? SDL_PRESSED :
   20.57                                                     SDL_RELEASED));
   20.58              break;
   20.59 @@ -539,8 +538,8 @@
   20.60                  break;
   20.61              case BUTTON:
   20.62                  SDL_PrivateJoystickButton(joystick, in->num,
   20.63 -                                          (Uint8) (evtbuf[i].
   20.64 -                                                   dwData ? SDL_PRESSED :
   20.65 +                                          (Uint8) (evtbuf[i].dwData ?
   20.66 +                                                   SDL_PRESSED :
   20.67                                                     SDL_RELEASED));
   20.68                  break;
   20.69              case HAT:
    21.1 --- a/src/loadso/macosx/SDL_dlcompat.c	Thu Aug 21 12:38:21 2008 +0000
    21.2 +++ b/src/loadso/macosx/SDL_dlcompat.c	Wed Aug 27 04:23:38 2008 +0000
    21.3 @@ -616,8 +616,8 @@
    21.4                  || (LC_LOAD_WEAK_DYLIB == lc->cmd)) {
    21.5                  if ((wh = (struct mach_header *)
    21.6                       my_find_image((char
    21.7 -                                    *) (((struct dylib_command *) lc)->
    21.8 -                                        dylib.name.offset + (char *) lc)))) {
    21.9 +                                    *) (((struct dylib_command *) lc)->dylib.
   21.10 +                                        name.offset + (char *) lc)))) {
   21.11                      if (dyld_NSIsSymbolNameDefinedInImage(wh, symbol)) {
   21.12                          nssym = dyld_NSLookupSymbolInImage(wh,
   21.13                                                             symbol,
   21.14 @@ -1067,6 +1067,7 @@
   21.15      return answer;
   21.16  
   21.17  }
   21.18 +
   21.19  static void *
   21.20  dlsym_auto_underscore_intern(void *handle, const char *symbol)
   21.21  {
    22.1 --- a/src/stdlib/SDL_stdlib.c	Thu Aug 21 12:38:21 2008 +0000
    22.2 +++ b/src/stdlib/SDL_stdlib.c	Wed Aug 27 04:23:38 2008 +0000
    22.3 @@ -135,6 +135,7 @@
    22.4      }
    22.5      /* *INDENT-ON* */
    22.6  }
    22.7 +
    22.8  void
    22.9  __declspec(naked)
   22.10  _alldiv()
   22.11 @@ -222,6 +223,7 @@
   22.12      }
   22.13      /* *INDENT-ON* */
   22.14  }
   22.15 +
   22.16  void
   22.17  __declspec(naked)
   22.18  _aulldiv()
   22.19 @@ -279,6 +281,7 @@
   22.20      }
   22.21      /* *INDENT-ON* */
   22.22  }
   22.23 +
   22.24  void
   22.25  __declspec(naked)
   22.26  _allrem()
   22.27 @@ -365,6 +368,7 @@
   22.28      }
   22.29      /* *INDENT-ON* */
   22.30  }
   22.31 +
   22.32  void
   22.33  __declspec(naked)
   22.34  _aullrem()
   22.35 @@ -423,6 +427,7 @@
   22.36      }
   22.37      /* *INDENT-ON* */
   22.38  }
   22.39 +
   22.40  void
   22.41  __declspec(naked)
   22.42  _alldvrm()
   22.43 @@ -532,6 +537,7 @@
   22.44      }
   22.45      /* *INDENT-ON* */
   22.46  }
   22.47 +
   22.48  void
   22.49  __declspec(naked)
   22.50  _aulldvrm()
   22.51 @@ -604,6 +610,7 @@
   22.52      }
   22.53      /* *INDENT-ON* */
   22.54  }
   22.55 +
   22.56  void
   22.57  __declspec(naked)
   22.58  _allshl()
   22.59 @@ -630,6 +637,7 @@
   22.60      }
   22.61      /* *INDENT-ON* */
   22.62  }
   22.63 +
   22.64  void
   22.65  __declspec(naked)
   22.66  _aullshr()
    23.1 --- a/src/thread/irix/SDL_syssem.c	Thu Aug 21 12:38:21 2008 +0000
    23.2 +++ b/src/thread/irix/SDL_syssem.c	Wed Aug 27 04:23:38 2008 +0000
    23.3 @@ -55,9 +55,11 @@
    23.4  static struct sembuf op_trywait[2] = {
    23.5      {0, -1, (IPC_NOWAIT | SEM_UNDO)}    /* Decrement semaphore, no block */
    23.6  };
    23.7 +
    23.8  static struct sembuf op_wait[2] = {
    23.9      {0, -1, SEM_UNDO}           /* Decrement semaphore */
   23.10  };
   23.11 +
   23.12  static struct sembuf op_post[1] = {
   23.13      {0, 1, (IPC_NOWAIT | SEM_UNDO)}     /* Increment semaphore */
   23.14  };
    24.1 --- a/src/timer/nds/SDL_systimer.c	Thu Aug 21 12:38:21 2008 +0000
    24.2 +++ b/src/timer/nds/SDL_systimer.c	Wed Aug 27 04:23:38 2008 +0000
    24.3 @@ -37,7 +37,7 @@
    24.4  void
    24.5  SDL_StartTicks(void)
    24.6  {
    24.7 -    if(!timer_alive) {
    24.8 +    if (!timer_alive) {
    24.9          SDL_SYS_TimerInit();
   24.10          SDL_SYS_StartTimer();
   24.11      }
   24.12 @@ -55,8 +55,9 @@
   24.13  SDL_Delay(Uint32 ms)
   24.14  {
   24.15      Uint32 start = SDL_GetTicks();
   24.16 -    while(timer_alive) {
   24.17 -        if((SDL_GetTicks() - start) >= ms) break;
   24.18 +    while (timer_alive) {
   24.19 +        if ((SDL_GetTicks() - start) >= ms)
   24.20 +            break;
   24.21      }
   24.22  }
   24.23  
   24.24 @@ -71,8 +72,10 @@
   24.25      return (0);
   24.26  }
   24.27  
   24.28 -void NDS_TimerInterrupt(void) {
   24.29 -	timer_ticks++;
   24.30 +void
   24.31 +NDS_TimerInterrupt(void)
   24.32 +{
   24.33 +    timer_ticks++;
   24.34  }
   24.35  
   24.36  /* This is only called if the event thread is not running */
    25.1 --- a/src/video/SDL_blit_0.c	Thu Aug 21 12:38:21 2008 +0000
    25.2 +++ b/src/video/SDL_blit_0.c	Wed Aug 27 04:23:38 2008 +0000
    25.3 @@ -80,6 +80,7 @@
    25.4          }
    25.5      }
    25.6  }
    25.7 +
    25.8  static void
    25.9  BlitBto2(SDL_BlitInfo * info)
   25.10  {
   25.11 @@ -116,6 +117,7 @@
   25.12          dst += dstskip;
   25.13      }
   25.14  }
   25.15 +
   25.16  static void
   25.17  BlitBto3(SDL_BlitInfo * info)
   25.18  {
   25.19 @@ -154,6 +156,7 @@
   25.20          dst += dstskip;
   25.21      }
   25.22  }
   25.23 +
   25.24  static void
   25.25  BlitBto4(SDL_BlitInfo * info)
   25.26  {
    26.1 --- a/src/video/SDL_blit_1.c	Thu Aug 21 12:38:21 2008 +0000
    26.2 +++ b/src/video/SDL_blit_1.c	Wed Aug 27 04:23:38 2008 +0000
    26.3 @@ -184,6 +184,7 @@
    26.4      }
    26.5  #endif /* USE_DUFFS_LOOP */
    26.6  }
    26.7 +
    26.8  static void
    26.9  Blit1to3(SDL_BlitInfo * info)
   26.10  {
   26.11 @@ -232,6 +233,7 @@
   26.12          dst += dstskip;
   26.13      }
   26.14  }
   26.15 +
   26.16  static void
   26.17  Blit1to4(SDL_BlitInfo * info)
   26.18  {
    27.1 --- a/src/video/SDL_blit_A.c	Thu Aug 21 12:38:21 2008 +0000
    27.2 +++ b/src/video/SDL_blit_A.c	Wed Aug 27 04:23:38 2008 +0000
    27.3 @@ -283,8 +283,8 @@
    27.4          amult = alpha | (alpha << 8);
    27.5          amult = amult | (amult << 16);
    27.6          chanmask =
    27.7 -            (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->
    27.8 -                                                           Bshift);
    27.9 +            (0xff << df->Rshift) | (0xff << df->
   27.10 +                                    Gshift) | (0xff << df->Bshift);
   27.11          mm_alpha = _mm_set_pi32(0, amult & chanmask);   /* 0000AAAA -> mm_alpha, minus 1 chan */
   27.12          mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */
   27.13          /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */
   27.14 @@ -526,8 +526,8 @@
   27.15      /* Use zero for alpha if either surface doesn't have alpha */
   27.16      if (dstfmt->Amask) {
   27.17          amask =
   27.18 -            ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->
   27.19 -                                                                   Ashift);
   27.20 +            ((srcfmt->Amask) ? RESHIFT(srcfmt->
   27.21 +                                       Ashift) : 0x10) << (dstfmt->Ashift);
   27.22      } else {
   27.23          amask =
   27.24              0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^
    28.1 --- a/src/video/SDL_blit_N.c	Thu Aug 21 12:38:21 2008 +0000
    28.2 +++ b/src/video/SDL_blit_N.c	Wed Aug 27 04:23:38 2008 +0000
    28.3 @@ -141,8 +141,8 @@
    28.4      /* Use zero for alpha if either surface doesn't have alpha */
    28.5      if (dstfmt->Amask) {
    28.6          amask =
    28.7 -            ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->
    28.8 -                                                                   Ashift);
    28.9 +            ((srcfmt->Amask) ? RESHIFT(srcfmt->
   28.10 +                                       Ashift) : 0x10) << (dstfmt->Ashift);
   28.11      } else {
   28.12          amask =
   28.13              0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^
   28.14 @@ -1435,6 +1435,7 @@
   28.15      0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100,
   28.16      0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200
   28.17  };
   28.18 +
   28.19  static void
   28.20  Blit_RGB565_ARGB8888(SDL_BlitInfo * info)
   28.21  {
   28.22 @@ -1572,6 +1573,7 @@
   28.23      0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff,
   28.24      0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff
   28.25  };
   28.26 +
   28.27  static void
   28.28  Blit_RGB565_ABGR8888(SDL_BlitInfo * info)
   28.29  {
   28.30 @@ -1709,6 +1711,7 @@
   28.31      0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000,
   28.32      0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000,
   28.33  };
   28.34 +
   28.35  static void
   28.36  Blit_RGB565_RGBA8888(SDL_BlitInfo * info)
   28.37  {
   28.38 @@ -1846,6 +1849,7 @@
   28.39      0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff,
   28.40      0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff
   28.41  };
   28.42 +
   28.43  static void
   28.44  Blit_RGB565_BGRA8888(SDL_BlitInfo * info)
   28.45  {
   28.46 @@ -1930,6 +1934,7 @@
   28.47      }
   28.48  #endif /* USE_DUFFS_LOOP */
   28.49  }
   28.50 +
   28.51  static void
   28.52  BlitNto1(SDL_BlitInfo * info)
   28.53  {
   28.54 @@ -2340,6 +2345,7 @@
   28.55      /* Default for 8-bit RGB source, an invalid combination */
   28.56      {0, 0, 0, 0, 0, 0, 0, 0, NULL},
   28.57  };
   28.58 +
   28.59  static const struct blit_table normal_blit_2[] = {
   28.60  #if SDL_ALTIVEC_BLITTERS
   28.61      /* has-altivec */
   28.62 @@ -2366,10 +2372,12 @@
   28.63      /* Default for 16-bit RGB source, used if no other blitter matches */
   28.64      {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
   28.65  };
   28.66 +
   28.67  static const struct blit_table normal_blit_3[] = {
   28.68      /* Default for 24-bit RGB source, never optimized */
   28.69      {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
   28.70  };
   28.71 +
   28.72  static const struct blit_table normal_blit_4[] = {
   28.73  #if SDL_ALTIVEC_BLITTERS
   28.74      /* has-altivec | dont-use-prefetch */
   28.75 @@ -2396,6 +2404,7 @@
   28.76      /* Default for 32-bit RGB source, used if no other blitter matches */
   28.77      {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
   28.78  };
   28.79 +
   28.80  static const struct blit_table *normal_blit[] = {
   28.81      normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
   28.82  };
    29.1 --- a/src/video/SDL_gamma.c	Thu Aug 21 12:38:21 2008 +0000
    29.2 +++ b/src/video/SDL_gamma.c	Wed Aug 27 04:23:38 2008 +0000
    29.3 @@ -70,6 +70,7 @@
    29.4          }
    29.5      }
    29.6  }
    29.7 +
    29.8  static void
    29.9  CalculateGammaFromRamp(float *gamma, Uint16 * ramp)
   29.10  {
    30.1 --- a/src/video/SDL_pixels.c	Thu Aug 21 12:38:21 2008 +0000
    30.2 +++ b/src/video/SDL_pixels.c	Wed Aug 27 04:23:38 2008 +0000
    30.3 @@ -752,6 +752,7 @@
    30.4          map->info.table = NULL;
    30.5      }
    30.6  }
    30.7 +
    30.8  int
    30.9  SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst)
   30.10  {
    31.1 --- a/src/video/SDL_renderer_sw.c	Thu Aug 21 12:38:21 2008 +0000
    31.2 +++ b/src/video/SDL_renderer_sw.c	Wed Aug 27 04:23:38 2008 +0000
    31.3 @@ -388,8 +388,9 @@
    31.4                        void **pixels, int *pitch)
    31.5  {
    31.6      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    31.7 -        return SDL_SW_QueryYUVTexturePixels((SDL_SW_YUVTexture *) texture->
    31.8 -                                            driverdata, pixels, pitch);
    31.9 +        return SDL_SW_QueryYUVTexturePixels((SDL_SW_YUVTexture *)
   31.10 +                                            texture->driverdata, pixels,
   31.11 +                                            pitch);
   31.12      } else {
   31.13          SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
   31.14  
   31.15 @@ -464,8 +465,9 @@
   31.16                   const SDL_Rect * rect, const void *pixels, int pitch)
   31.17  {
   31.18      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
   31.19 -        return SDL_SW_UpdateYUVTexture((SDL_SW_YUVTexture *) texture->
   31.20 -                                       driverdata, rect, pixels, pitch);
   31.21 +        return SDL_SW_UpdateYUVTexture((SDL_SW_YUVTexture *)
   31.22 +                                       texture->driverdata, rect, pixels,
   31.23 +                                       pitch);
   31.24      } else {
   31.25          SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
   31.26          Uint8 *src, *dst;
   31.27 @@ -492,9 +494,9 @@
   31.28                 int *pitch)
   31.29  {
   31.30      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
   31.31 -        return SDL_SW_LockYUVTexture((SDL_SW_YUVTexture *) texture->
   31.32 -                                     driverdata, rect, markDirty, pixels,
   31.33 -                                     pitch);
   31.34 +        return SDL_SW_LockYUVTexture((SDL_SW_YUVTexture *)
   31.35 +                                     texture->driverdata, rect, markDirty,
   31.36 +                                     pixels, pitch);
   31.37      } else {
   31.38          SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
   31.39  
   31.40 @@ -535,10 +537,10 @@
   31.41  
   31.42      color = SDL_MapRGBA(data->surface.format, r, g, b, a);
   31.43  
   31.44 -    if (data->renderer->
   31.45 -        LockTexture(data->renderer, data->texture[data->current_texture],
   31.46 -                    rect, 1, &data->surface.pixels,
   31.47 -                    &data->surface.pitch) < 0) {
   31.48 +    if (data->renderer->LockTexture(data->renderer,
   31.49 +                                    data->texture[data->current_texture],
   31.50 +                                    rect, 1, &data->surface.pixels,
   31.51 +                                    &data->surface.pitch) < 0) {
   31.52          return -1;
   31.53      }
   31.54      data->surface.w = rect->w;
   31.55 @@ -566,10 +568,10 @@
   31.56          SDL_AddDirtyRect(&data->dirty, dstrect);
   31.57      }
   31.58  
   31.59 -    if (data->renderer->
   31.60 -        LockTexture(data->renderer, data->texture[data->current_texture],
   31.61 -                    dstrect, 1, &data->surface.pixels,
   31.62 -                    &data->surface.pitch) < 0) {
   31.63 +    if (data->renderer->LockTexture(data->renderer,
   31.64 +                                    data->texture[data->current_texture],
   31.65 +                                    dstrect, 1, &data->surface.pixels,
   31.66 +                                    &data->surface.pitch) < 0) {
   31.67          return -1;
   31.68      }
   31.69  
    32.1 --- a/src/video/SDL_surface.c	Thu Aug 21 12:38:21 2008 +0000
    32.2 +++ b/src/video/SDL_surface.c	Wed Aug 27 04:23:38 2008 +0000
    32.3 @@ -409,9 +409,9 @@
    32.4          return 0;
    32.5      }
    32.6  
    32.7 -    switch (surface->map->info.
    32.8 -            flags & (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD |
    32.9 -                     SDL_COPY_MOD)) {
   32.10 +    switch (surface->map->
   32.11 +            info.flags & (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD |
   32.12 +                          SDL_COPY_MOD)) {
   32.13      case SDL_COPY_MASK:
   32.14          *blendMode = SDL_TEXTUREBLENDMODE_MASK;
   32.15          break;
    33.1 --- a/src/video/ataricommon/SDL_atarigl.c	Thu Aug 21 12:38:21 2008 +0000
    33.2 +++ b/src/video/ataricommon/SDL_atarigl.c	Wed Aug 27 04:23:38 2008 +0000
    33.3 @@ -349,9 +349,9 @@
    33.4      }
    33.5  
    33.6      if (!
    33.7 -        (_this->gl_data->
    33.8 -         OSMesaMakeCurrent(gl_ctx, surface->pixels, type, surface->w,
    33.9 -                           surface->h))) {
   33.10 +        (_this->
   33.11 +         gl_data->OSMesaMakeCurrent(gl_ctx, surface->pixels, type, surface->w,
   33.12 +                                    surface->h))) {
   33.13          SDL_SetError("Can not make OpenGL context current");
   33.14          return -1;
   33.15      }
   33.16 @@ -512,10 +512,10 @@
   33.17  
   33.18          gl_ctx =
   33.19              _this->gl_data->OSMesaCreateContextExt(osmesa_format,
   33.20 -                                                   _this->gl_config.
   33.21 -                                                   depth_size,
   33.22 -                                                   _this->gl_config.
   33.23 -                                                   stencil_size,
   33.24 +                                                   _this->
   33.25 +                                                   gl_config.depth_size,
   33.26 +                                                   _this->
   33.27 +                                                   gl_config.stencil_size,
   33.28                                                     newaccumsize, NULL);
   33.29  
   33.30          if (gl_ctx) {
    34.1 --- a/src/video/bwindow/SDL_sysvideo.cc	Thu Aug 21 12:38:21 2008 +0000
    34.2 +++ b/src/video/bwindow/SDL_sysvideo.cc	Wed Aug 27 04:23:38 2008 +0000
    34.3 @@ -670,8 +670,8 @@
    34.4                          _this->gl_config.driver_loaded = 1;
    34.5                          SDL_strlcpy(_this->gl_config.driver_path,
    34.6                                      "libGL.so",
    34.7 -                                    SDL_arraysize(_this->gl_config.
    34.8 -                                                  driver_path));
    34.9 +                                    SDL_arraysize(_this->
   34.10 +                                                  gl_config.driver_path));
   34.11                      }
   34.12                  }
   34.13              }
    35.1 --- a/src/video/dc/SDL_dcevents.c	Thu Aug 21 12:38:21 2008 +0000
    35.2 +++ b/src/video/dc/SDL_dcevents.c	Wed Aug 27 04:23:38 2008 +0000
    35.3 @@ -135,8 +135,7 @@
    35.4      for (i = 0; i < sizeof(sdl_shift); i++) {
    35.5          if ((shiftkeys >> i) & 1) {
    35.6              keysym.sym = sdl_shift[i];
    35.7 -            SDL_PrivateKeyboard(((state->
    35.8 -                                  shift_keys >> i) & 1) ? SDL_PRESSED :
    35.9 +            SDL_PrivateKeyboard(((state->shift_keys >> i) & 1) ? SDL_PRESSED :
   35.10                                  SDL_RELEASED, &keysym);
   35.11          }
   35.12      }
   35.13 @@ -146,8 +145,7 @@
   35.14              int key = sdl_key[i];
   35.15              if (key) {
   35.16                  keysym.sym = key;
   35.17 -                SDL_PrivateKeyboard(state->
   35.18 -                                    matrix[i] ? SDL_PRESSED :
   35.19 +                SDL_PrivateKeyboard(state->matrix[i] ? SDL_PRESSED :
   35.20                                      SDL_RELEASED, &keysym);
   35.21              }
   35.22          }
    36.1 --- a/src/video/dc/SDL_dcvideo.c	Thu Aug 21 12:38:21 2008 +0000
    36.2 +++ b/src/video/dc/SDL_dcvideo.c	Wed Aug 27 04:23:38 2008 +0000
    36.3 @@ -158,6 +158,7 @@
    36.4  const static SDL_Rect RECT_800x600 = { 0, 0, 800, 600 }, RECT_640x480 = {
    36.5  0, 0, 640, 480}, RECT_320x240 = {
    36.6  0, 0, 320, 240};
    36.7 +
    36.8  const static SDL_Rect *vid_modes[] = {
    36.9      &RECT_800x600,
   36.10      &RECT_640x480,
   36.11 @@ -296,6 +297,7 @@
   36.12  {
   36.13      return (-1);
   36.14  }
   36.15 +
   36.16  static void
   36.17  DC_FreeHWSurface(_THIS, SDL_Surface * surface)
   36.18  {
    37.1 --- a/src/video/directfb/SDL_DirectFB_events.c	Thu Aug 21 12:38:21 2008 +0000
    37.2 +++ b/src/video/directfb/SDL_DirectFB_events.c	Wed Aug 27 04:23:38 2008 +0000
    37.3 @@ -311,33 +311,25 @@
    37.4              switch (evt.type) {
    37.5              case DIET_BUTTONPRESS:
    37.6                  posted += SDL_PrivateMouseButton(SDL_PRESSED,
    37.7 -                                                 DirectFB_TranslateButton(evt.
    37.8 -                                                                          button),
    37.9 -                                                 0, 0);
   37.10 +                                                 DirectFB_TranslateButton
   37.11 +                                                 (evt.button), 0, 0);
   37.12                  break;
   37.13              case DIET_BUTTONRELEASE:
   37.14                  posted += SDL_PrivateMouseButton(SDL_RELEASED,
   37.15 -                                                 DirectFB_TranslateButton(evt.
   37.16 -                                                                          button),
   37.17 -                                                 0, 0);
   37.18 +                                                 DirectFB_TranslateButton
   37.19 +                                                 (evt.button), 0, 0);
   37.20                  break;
   37.21              case DIET_KEYPRESS:
   37.22                  posted += SDL_PrivateKeyboard(SDL_PRESSED,
   37.23 -                                              DirectFB_TranslateKey(evt.
   37.24 -                                                                    key_id,
   37.25 -                                                                    evt.
   37.26 -                                                                    key_symbol,
   37.27 -                                                                    mod,
   37.28 -                                                                    &keysym));
   37.29 +                                              DirectFB_TranslateKey
   37.30 +                                              (evt.key_id, evt.key_symbol,
   37.31 +                                               mod, &keysym));
   37.32                  break;
   37.33              case DIET_KEYRELEASE:
   37.34                  posted += SDL_PrivateKeyboard(SDL_RELEASED,
   37.35 -                                              DirectFB_TranslateKey(evt.
   37.36 -                                                                    key_id,
   37.37 -                                                                    evt.
   37.38 -                                                                    key_symbol,
   37.39 -                                                                    mod,
   37.40 -                                                                    &keysym));
   37.41 +                                              DirectFB_TranslateKey
   37.42 +                                              (evt.key_id, evt.key_symbol,
   37.43 +                                               mod, &keysym));
   37.44                  break;
   37.45              case DIET_AXISMOTION:
   37.46                  if (evt.flags & DIEF_AXISREL) {
    38.1 --- a/src/video/directfb/SDL_DirectFB_mouse.c	Thu Aug 21 12:38:21 2008 +0000
    38.2 +++ b/src/video/directfb/SDL_DirectFB_mouse.c	Wed Aug 27 04:23:38 2008 +0000
    38.3 @@ -85,14 +85,15 @@
    38.4      dsc.height = surface->h;
    38.5      dsc.pixelformat = DSPF_ARGB;
    38.6  
    38.7 -    SDL_DFB_CHECKERR(devdata->dfb->
    38.8 -                     CreateSurface(devdata->dfb, &dsc, &curdata->surf));
    38.9 +    SDL_DFB_CHECKERR(devdata->
   38.10 +                     dfb->CreateSurface(devdata->dfb, &dsc, &curdata->surf));
   38.11      curdata->hotx = hot_x;
   38.12      curdata->hoty = hot_y;
   38.13      cursor->driverdata = curdata;
   38.14  
   38.15 -    SDL_DFB_CHECKERR(curdata->surf->
   38.16 -                     Lock(curdata->surf, DSLF_WRITE, (void *) &dest, &pitch));
   38.17 +    SDL_DFB_CHECKERR(curdata->
   38.18 +                     surf->Lock(curdata->surf, DSLF_WRITE, (void *) &dest,
   38.19 +                                &pitch));
   38.20  
   38.21      //FIXME: Implies a lot of things, e.g. rgba format for SDL_SURFACE ....
   38.22      p = surface->pixels;
   38.23 @@ -133,19 +134,19 @@
   38.24          DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
   38.25  
   38.26          if (cursor)
   38.27 -            SDL_DFB_CHECKERR(windata->window->
   38.28 -                             SetCursorShape(windata->window, curdata->surf,
   38.29 -                                            curdata->hotx, curdata->hoty));
   38.30 +            SDL_DFB_CHECKERR(windata->window->SetCursorShape(windata->window,
   38.31 +                                                             curdata->surf,
   38.32 +                                                             curdata->hotx,
   38.33 +                                                             curdata->hoty));
   38.34          //FIXME: This is somehow a directfb issue
   38.35          //TODO: Check administrative 
   38.36 -        SDL_DFB_CHECKERR(dispdata->layer->
   38.37 -                         SetCooperativeLevel(dispdata->layer,
   38.38 -                                             DLSCL_ADMINISTRATIVE));
   38.39 -        SDL_DFB_CHECKERR(dispdata->layer->
   38.40 -                         SetCursorOpacity(dispdata->layer,
   38.41 -                                          cursor ? 0xC0 : 0x00));
   38.42 -        SDL_DFB_CHECKERR(dispdata->layer->
   38.43 -                         SetCooperativeLevel(dispdata->layer, DLSCL_SHARED));
   38.44 +        SDL_DFB_CHECKERR(dispdata->layer->SetCooperativeLevel(dispdata->layer,
   38.45 +                                                              DLSCL_ADMINISTRATIVE));
   38.46 +        SDL_DFB_CHECKERR(dispdata->layer->SetCursorOpacity(dispdata->layer,
   38.47 +                                                           cursor ? 0xC0 :
   38.48 +                                                           0x00));
   38.49 +        SDL_DFB_CHECKERR(dispdata->layer->SetCooperativeLevel(dispdata->layer,
   38.50 +                                                              DLSCL_SHARED));
   38.51      }
   38.52  
   38.53      return 0;
   38.54 @@ -185,8 +186,8 @@
   38.55      int cx, cy;
   38.56  
   38.57      SDL_DFB_CHECKERR(windata->window->GetPosition(windata->window, &cx, &cy));
   38.58 -    SDL_DFB_CHECKERR(dispdata->layer->
   38.59 -                     WarpCursor(dispdata->layer, cx + x, cy + y));
   38.60 +    SDL_DFB_CHECKERR(dispdata->
   38.61 +                     layer->WarpCursor(dispdata->layer, cx + x, cy + y));
   38.62  
   38.63    error:
   38.64      return;
    39.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Thu Aug 21 12:38:21 2008 +0000
    39.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Wed Aug 27 04:23:38 2008 +0000
    39.3 @@ -315,23 +315,22 @@
    39.4      data->vidlayer = NULL;
    39.5      if (renddata->isyuvdirect && (dispdata->vidID >= 0)
    39.6          && SDL_ISPIXELFORMAT_FOURCC(data->format)) {
    39.7 -        SDL_DFB_CHECKERR(devdata->dfb->
    39.8 -                         GetDisplayLayer(devdata->dfb, dispdata->vidID,
    39.9 -                                         &data->vidlayer));
   39.10 +        SDL_DFB_CHECKERR(devdata->
   39.11 +                         dfb->GetDisplayLayer(devdata->dfb, dispdata->vidID,
   39.12 +                                              &data->vidlayer));
   39.13          layconf.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT;
   39.14          layconf.width = texture->w;
   39.15          layconf.height = texture->h;
   39.16          layconf.pixelformat = SDLToDFBPixelFormat(data->format);
   39.17  
   39.18 -        SDL_DFB_CHECKERR(data->vidlayer->
   39.19 -                         SetCooperativeLevel(data->vidlayer,
   39.20 -                                             DLSCL_EXCLUSIVE));
   39.21 -        SDL_DFB_CHECKERR(data->vidlayer->
   39.22 -                         SetConfiguration(data->vidlayer, &layconf));
   39.23 -        SDL_DFB_CHECKERR(data->vidlayer->
   39.24 -                         GetSurface(data->vidlayer, &data->surface));
   39.25 -        SDL_DFB_CHECKERR(data->vidlayer->
   39.26 -                         GetDescription(data->vidlayer, &laydsc));
   39.27 +        SDL_DFB_CHECKERR(data->vidlayer->SetCooperativeLevel(data->vidlayer,
   39.28 +                                                             DLSCL_EXCLUSIVE));
   39.29 +        SDL_DFB_CHECKERR(data->vidlayer->SetConfiguration(data->vidlayer,
   39.30 +                                                          &layconf));
   39.31 +        SDL_DFB_CHECKERR(data->vidlayer->GetSurface(data->vidlayer,
   39.32 +                                                    &data->surface));
   39.33 +        SDL_DFB_CHECKERR(data->
   39.34 +                         vidlayer->GetDescription(data->vidlayer, &laydsc));
   39.35          SDL_DFB_DEBUG("Created HW YUV surface\n");
   39.36      }
   39.37      if (!data->vidlayer) {
   39.38 @@ -356,12 +355,12 @@
   39.39          data->pixels = NULL;
   39.40  
   39.41          /* Create the surface */
   39.42 -        SDL_DFB_CHECKERR(devdata->dfb->
   39.43 -                         CreateSurface(devdata->dfb, &dsc, &data->surface));
   39.44 +        SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
   39.45 +                                                     &data->surface));
   39.46          if (SDL_ISPIXELFORMAT_INDEXED(data->format)
   39.47              && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
   39.48 -            SDL_DFB_CHECKERR(data->surface->
   39.49 -                             GetPalette(data->surface, &data->palette));
   39.50 +            SDL_DFB_CHECKERR(data->surface->GetPalette(data->surface,
   39.51 +                                                       &data->palette));
   39.52          }
   39.53  
   39.54      }
   39.55 @@ -408,9 +407,9 @@
   39.56              entries[i].b = colors[i].b;
   39.57              entries[i].a = 0xFF;
   39.58          }
   39.59 -        SDL_DFB_CHECKERR(data->palette->
   39.60 -                         SetEntries(data->palette, entries, ncolors,
   39.61 -                                    firstcolor));
   39.62 +        SDL_DFB_CHECKERR(data->
   39.63 +                         palette->SetEntries(data->palette, entries, ncolors,
   39.64 +                                             firstcolor));
   39.65          return 0;
   39.66      } else {
   39.67          SDL_SetError("YUV textures don't have a palette");
   39.68 @@ -432,9 +431,9 @@
   39.69          DFBColor entries[256];
   39.70          int i;
   39.71  
   39.72 -        SDL_DFB_CHECKERR(data->palette->
   39.73 -                         GetEntries(data->palette, entries, ncolors,
   39.74 -                                    firstcolor));
   39.75 +        SDL_DFB_CHECKERR(data->
   39.76 +                         palette->GetEntries(data->palette, entries, ncolors,
   39.77 +                                             firstcolor));
   39.78  
   39.79          for (i = 0; i < ncolors; ++i) {
   39.80              colors[i].r = entries[i].r;
   39.81 @@ -596,9 +595,9 @@
   39.82      DFBResult ret;
   39.83  
   39.84      SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, r, g, b, a));
   39.85 -    SDL_DFB_CHECKERR(data->surface->
   39.86 -                     FillRectangle(data->surface, rect->x, rect->y, rect->w,
   39.87 -                                   rect->h));
   39.88 +    SDL_DFB_CHECKERR(data->
   39.89 +                     surface->FillRectangle(data->surface, rect->x, rect->y,
   39.90 +                                            rect->w, rect->h));
   39.91  
   39.92      return 0;
   39.93    error:
   39.94 @@ -622,15 +621,18 @@
   39.95          DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
   39.96          SDL_DFB_WINDOWDATA(window);
   39.97  
   39.98 -        SDL_DFB_CHECKERR(texturedata->vidlayer->
   39.99 -                         SetSourceRectangle(texturedata->vidlayer, srcrect->x,
  39.100 -                                            srcrect->y, srcrect->w,
  39.101 -                                            srcrect->h));
  39.102 +        SDL_DFB_CHECKERR(texturedata->
  39.103 +                         vidlayer->SetSourceRectangle(texturedata->vidlayer,
  39.104 +                                                      srcrect->x, srcrect->y,
  39.105 +                                                      srcrect->w,
  39.106 +                                                      srcrect->h));
  39.107          windata->window->GetPosition(windata->window, &px, &py);
  39.108 -        SDL_DFB_CHECKERR(texturedata->vidlayer->
  39.109 -                         SetScreenRectangle(texturedata->vidlayer,
  39.110 -                                            px + dstrect->x, py + dstrect->y,
  39.111 -                                            dstrect->w, dstrect->h));
  39.112 +        SDL_DFB_CHECKERR(texturedata->
  39.113 +                         vidlayer->SetScreenRectangle(texturedata->vidlayer,
  39.114 +                                                      px + dstrect->x,
  39.115 +                                                      py + dstrect->y,
  39.116 +                                                      dstrect->w,
  39.117 +                                                      dstrect->h));
  39.118      } else {
  39.119          DFBRectangle sr, dr;
  39.120          DFBSurfaceBlittingFlags flags = 0;
  39.121 @@ -645,16 +647,16 @@
  39.122          dr.w = dstrect->w;
  39.123          dr.h = dstrect->h;
  39.124  
  39.125 -        if (texture->
  39.126 -            modMode & (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA))
  39.127 -        {
  39.128 +        if (texture->modMode &
  39.129 +            (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA)) {
  39.130              u8 alpha = 0xFF;
  39.131              if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA)
  39.132                  alpha = texture->a;
  39.133              if (texture->modMode & SDL_TEXTUREMODULATE_COLOR)
  39.134 -                SDL_DFB_CHECKERR(data->surface->
  39.135 -                                 SetColor(data->surface, texture->r,
  39.136 -                                          texture->g, texture->b, alpha));
  39.137 +                SDL_DFB_CHECKERR(data->
  39.138 +                                 surface->SetColor(data->surface, texture->r,
  39.139 +                                                   texture->g, texture->b,
  39.140 +                                                   alpha));
  39.141              else
  39.142                  SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF,
  39.143                                                           0xFF, 0xFF, alpha));
  39.144 @@ -662,23 +664,22 @@
  39.145              flags |= DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR;
  39.146          }
  39.147  
  39.148 -        if (texture->
  39.149 -            blendMode & (SDL_TEXTUREBLENDMODE_MASK |
  39.150 -                         SDL_TEXTUREBLENDMODE_BLEND)) {
  39.151 +        if (texture->blendMode & (SDL_TEXTUREBLENDMODE_MASK |
  39.152 +                                  SDL_TEXTUREBLENDMODE_BLEND)) {
  39.153              flags |= DSBLIT_BLEND_ALPHACHANNEL;
  39.154          } else {
  39.155              flags |= DSBLIT_NOFX;
  39.156          }
  39.157 -        SDL_DFB_CHECKERR(data->surface->
  39.158 -                         SetBlittingFlags(data->surface, flags));
  39.159 +        SDL_DFB_CHECKERR(data->
  39.160 +                         surface->SetBlittingFlags(data->surface, flags));
  39.161          if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
  39.162 -            SDL_DFB_CHECKERR(data->surface->
  39.163 -                             Blit(data->surface, texturedata->surface, &sr,
  39.164 -                                  dr.x, dr.y));
  39.165 +            SDL_DFB_CHECKERR(data->surface->Blit(data->surface,
  39.166 +                                                 texturedata->surface, &sr,
  39.167 +                                                 dr.x, dr.y));
  39.168          } else {
  39.169 -            SDL_DFB_CHECKERR(data->surface->
  39.170 -                             StretchBlit(data->surface, texturedata->surface,
  39.171 -                                         &sr, &dr));
  39.172 +            SDL_DFB_CHECKERR(data->surface->StretchBlit(data->surface,
  39.173 +                                                        texturedata->surface,
  39.174 +                                                        &sr, &dr));
  39.175          }
  39.176      }
  39.177      return 0;
  39.178 @@ -702,8 +703,8 @@
  39.179      sr.h = window->h;
  39.180  
  39.181      /* Send the data to the display */
  39.182 -    SDL_DFB_CHECKERR(data->surface->
  39.183 -                     Flip(data->surface, NULL, data->flipflags));
  39.184 +    SDL_DFB_CHECKERR(data->
  39.185 +                     surface->Flip(data->surface, NULL, data->flipflags));
  39.186  
  39.187      return;
  39.188    error:
    40.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Thu Aug 21 12:38:21 2008 +0000
    40.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Wed Aug 27 04:23:38 2008 +0000
    40.3 @@ -323,8 +323,8 @@
    40.4          SDL_DFB_CHECKERR(dfb->GetScreen(dfb, devdata->screenid[i], &screen));
    40.5  
    40.6          devdata->aux = i;
    40.7 -        SDL_DFB_CHECKERR(screen->
    40.8 -                         EnumDisplayLayers(screen, &cbLayers, devdata));
    40.9 +        SDL_DFB_CHECKERR(screen->EnumDisplayLayers
   40.10 +                         (screen, &cbLayers, devdata));
   40.11          screen->GetSize(screen, &tcw[i], &tch[i]);
   40.12          screen->Release(screen);
   40.13      }
   40.14 @@ -339,12 +339,12 @@
   40.15  
   40.16      for (i = 0; i < devdata->numscreens; i++) {
   40.17          //SDL_DFB_CHECKERR( dfb->GetDisplayLayer (dfb, DLID_PRIMARY, &layer) );
   40.18 -        SDL_DFB_CHECKERR(dfb->
   40.19 -                         GetDisplayLayer(dfb, devdata->gralayer[i], &layer));
   40.20 +        SDL_DFB_CHECKERR(dfb->GetDisplayLayer
   40.21 +                         (dfb, devdata->gralayer[i], &layer));
   40.22          //SDL_DFB_CHECKERR( dfb->CreateInputEventBuffer (dfb, DICAPS_ALL, DFB_FALSE, &events) );
   40.23  
   40.24 -        SDL_DFB_CHECKERR(layer->
   40.25 -                         SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE));
   40.26 +        SDL_DFB_CHECKERR(layer->SetCooperativeLevel
   40.27 +                         (layer, DLSCL_ADMINISTRATIVE));
   40.28          layer->EnableCursor(layer, 1);
   40.29          SDL_DFB_CHECKERR(layer->SetCursorOpacity(layer, 0xC0));
   40.30          SDL_DFB_CHECKERR(layer->SetCooperativeLevel(layer, DLSCL_SHARED));
   40.31 @@ -379,8 +379,8 @@
   40.32          /* Enumerate the available fullscreen modes */
   40.33          SDL_DFB_CALLOC(dispdata->modelist, DFB_MAX_MODES,
   40.34                         sizeof(SDL_DisplayMode));
   40.35 -        SDL_DFB_CHECKERR(dfb->
   40.36 -                         EnumVideoModes(dfb, EnumModesCallback, &display));
   40.37 +        SDL_DFB_CHECKERR(dfb->EnumVideoModes
   40.38 +                         (dfb, EnumModesCallback, &display));
   40.39  
   40.40          SDL_AddVideoDisplay(&display);
   40.41      }
   40.42 @@ -434,13 +434,14 @@
   40.43          DFB_DisplayData *dispdata =
   40.44              (DFB_DisplayData *) _this->displays[i].driverdata;
   40.45          if (dispdata->layer) {
   40.46 -            SDL_DFB_CHECK(dispdata->layer->
   40.47 -                          SetCooperativeLevel(dispdata->layer,
   40.48 -                                              DLSCL_ADMINISTRATIVE));
   40.49 -            SDL_DFB_CHECK(dispdata->layer->
   40.50 -                          SetCursorOpacity(dispdata->layer, 0x00));
   40.51 -            SDL_DFB_CHECK(dispdata->layer->
   40.52 -                          SetCooperativeLevel(dispdata->layer, DLSCL_SHARED));
   40.53 +            SDL_DFB_CHECK(dispdata->
   40.54 +                          layer->SetCooperativeLevel(dispdata->layer,
   40.55 +                                                     DLSCL_ADMINISTRATIVE));
   40.56 +            SDL_DFB_CHECK(dispdata->
   40.57 +                          layer->SetCursorOpacity(dispdata->layer, 0x00));
   40.58 +            SDL_DFB_CHECK(dispdata->
   40.59 +                          layer->SetCooperativeLevel(dispdata->layer,
   40.60 +                                                     DLSCL_SHARED));
   40.61          }
   40.62          SDL_DFB_RELEASE(dispdata->layer);
   40.63  
   40.64 @@ -580,8 +581,8 @@
   40.65      DFBDisplayLayerConfigFlags fail = 0;
   40.66      DFBResult ret;
   40.67  
   40.68 -    SDL_DFB_CHECKERR(data->layer->
   40.69 -                     SetCooperativeLevel(data->layer, DLSCL_ADMINISTRATIVE));
   40.70 +    SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer,
   40.71 +                                                      DLSCL_ADMINISTRATIVE));
   40.72  
   40.73      SDL_DFB_CHECKERR(data->layer->GetConfiguration(data->layer, &config));
   40.74      config.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_BUFFERMODE;
   40.75 @@ -606,8 +607,8 @@
   40.76      SDL_DFB_DEBUG("Trace\n");
   40.77      config.flags &= ~fail;
   40.78      SDL_DFB_CHECKERR(data->layer->SetConfiguration(data->layer, &config));
   40.79 -    SDL_DFB_CHECKERR(data->layer->
   40.80 -                     SetCooperativeLevel(data->layer, DLSCL_ADMINISTRATIVE));
   40.81 +    SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer,
   40.82 +                                                      DLSCL_ADMINISTRATIVE));
   40.83  
   40.84      /* Double check */
   40.85      SDL_DFB_CHECKERR(data->layer->GetConfiguration(data->layer, &rconfig));
   40.86 @@ -653,11 +654,11 @@
   40.87      SDL_DFB_CALLOC(window->driverdata, 1, sizeof(DFB_WindowData));
   40.88      windata = (DFB_WindowData *) window->driverdata;
   40.89  
   40.90 -    SDL_DFB_CHECKERR(devdata->dfb->
   40.91 -                     SetCooperativeLevel(devdata->dfb, DFSCL_NORMAL));
   40.92 -    SDL_DFB_CHECKERR(dispdata->layer->
   40.93 -                     SetCooperativeLevel(dispdata->layer,
   40.94 -                                         DLSCL_ADMINISTRATIVE));
   40.95 +    SDL_DFB_CHECKERR(devdata->
   40.96 +                     dfb->SetCooperativeLevel(devdata->dfb, DFSCL_NORMAL));
   40.97 +    SDL_DFB_CHECKERR(dispdata->
   40.98 +                     layer->SetCooperativeLevel(dispdata->layer,
   40.99 +                                                DLSCL_ADMINISTRATIVE));
  40.100  
  40.101      /* Fill the window description. */
  40.102      if (window->x == SDL_WINDOWPOS_CENTERED) {
  40.103 @@ -697,8 +698,8 @@
  40.104      desc.surface_caps = DSCAPS_DOUBLE | DSCAPS_TRIPLE;  //| DSCAPS_PREMULTIPLIED;
  40.105  
  40.106      /* Create the window. */
  40.107 -    SDL_DFB_CHECKERR(dispdata->layer->
  40.108 -                     CreateWindow(dispdata->layer, &desc, &windata->window));
  40.109 +    SDL_DFB_CHECKERR(dispdata->layer->CreateWindow(dispdata->layer, &desc,
  40.110 +                                                   &windata->window));
  40.111  
  40.112      windata->window->GetOptions(windata->window, &wopts);
  40.113  #if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 0)
  40.114 @@ -716,12 +717,13 @@
  40.115  
  40.116      windata->window->SetOptions(windata->window, wopts);
  40.117      /* Get the window's surface. */
  40.118 -    SDL_DFB_CHECKERR(windata->window->
  40.119 -                     GetSurface(windata->window, &windata->surface));
  40.120 +    SDL_DFB_CHECKERR(windata->
  40.121 +                     window->GetSurface(windata->window, &windata->surface));
  40.122      windata->window->SetOpacity(windata->window, 0xFF);
  40.123 -    SDL_DFB_CHECKERR(windata->window->
  40.124 -                     CreateEventBuffer(windata->window,
  40.125 -                                       &(windata->eventbuffer)));
  40.126 +    SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window,
  40.127 +                                                        &
  40.128 +                                                        (windata->
  40.129 +                                                         eventbuffer)));
  40.130      SDL_DFB_CHECKERR(windata->window->
  40.131                       EnableEvents(windata->window,
  40.132                                    DWET_POSITION | DWET_SIZE | DWET_CLOSE |
  40.133 @@ -784,6 +786,7 @@
  40.134      //return -1;
  40.135  
  40.136  }
  40.137 +
  40.138  static void
  40.139  DirectFB_SetWindowPosition(_THIS, SDL_Window * window)
  40.140  {
  40.141 @@ -805,6 +808,7 @@
  40.142      if (!(window->flags & SDL_WINDOW_FULLSCREEN))
  40.143          windata->window->Resize(windata->window, window->w, window->h);
  40.144  }
  40.145 +
  40.146  static void
  40.147  DirectFB_ShowWindow(_THIS, SDL_Window * window)
  40.148  {
  40.149 @@ -827,6 +831,7 @@
  40.150      windata->window->SetOpacity(windata->window, 0);
  40.151  
  40.152  }
  40.153 +
  40.154  static void
  40.155  DirectFB_RaiseWindow(_THIS, SDL_Window * window)
  40.156  {
  40.157 @@ -848,6 +853,7 @@
  40.158      SDL_Unsupported();
  40.159  
  40.160  }
  40.161 +
  40.162  static void
  40.163  DirectFB_MinimizeWindow(_THIS, SDL_Window * window)
  40.164  {
  40.165 @@ -869,6 +875,7 @@
  40.166      SDL_Unsupported();
  40.167  
  40.168  }
  40.169 +
  40.170  static void
  40.171  DirectFB_SetWindowGrab(_THIS, SDL_Window * window)
  40.172  {
  40.173 @@ -1097,8 +1104,8 @@
  40.174          devdata->glFlush();
  40.175  
  40.176      SDL_DFB_CHECKERR(windata->gl_context->Unlock(windata->gl_context));
  40.177 -    SDL_DFB_CHECKERR(windata->surface->
  40.178 -                     Flip(windata->surface, &region, DSFLIP_ONSYNC));
  40.179 +    SDL_DFB_CHECKERR(windata->
  40.180 +                     surface->Flip(windata->surface, &region, DSFLIP_ONSYNC));
  40.181      SDL_DFB_CHECKERR(windata->gl_context->Lock(windata->gl_context));
  40.182  
  40.183      return;
    41.1 --- a/src/video/fbcon/SDL_fb3dfx.c	Thu Aug 21 12:38:21 2008 +0000
    41.2 +++ b/src/video/fbcon/SDL_fb3dfx.c	Wed Aug 27 04:23:38 2008 +0000
    41.3 @@ -37,6 +37,7 @@
    41.4      /* wait until we're past the start */
    41.5      while ((tdfx_in32(TDFX_STATUS) & STATUS_RETRACE) == 0);
    41.6  }
    41.7 +
    41.8  static void
    41.9  WaitIdle(_THIS)
   41.10  {
    42.1 --- a/src/video/fbcon/SDL_fbevents.c	Thu Aug 21 12:38:21 2008 +0000
    42.2 +++ b/src/video/fbcon/SDL_fbevents.c	Wed Aug 27 04:23:38 2008 +0000
    42.3 @@ -969,6 +969,7 @@
    42.4      ioctl(keyboard_fd, KDSETMODE, KD_TEXT);
    42.5      ioctl(keyboard_fd, VT_UNLOCKSWITCH, 1);
    42.6  }
    42.7 +
    42.8  static void
    42.9  switch_vt_done(_THIS)
   42.10  {
   42.11 @@ -994,6 +995,7 @@
   42.12                           (SDL_APPACTIVE | SDL_APPINPUTFOCUS |
   42.13                            SDL_APPMOUSEFOCUS));
   42.14  }
   42.15 +
   42.16  static void
   42.17  switch_vt(_THIS, unsigned short which)
   42.18  {
    43.1 --- a/src/video/fbcon/SDL_fbmatrox.c	Thu Aug 21 12:38:21 2008 +0000
    43.2 +++ b/src/video/fbcon/SDL_fbmatrox.c	Wed Aug 27 04:23:38 2008 +0000
    43.3 @@ -41,6 +41,7 @@
    43.4      count = mga_in32(0x1E20) + 2;
    43.5      while (mga_in32(0x1E20) < count);
    43.6  }
    43.7 +
    43.8  static void
    43.9  WaitIdle(_THIS)
   43.10  {
    44.1 --- a/src/video/fbcon/SDL_fbriva.c	Thu Aug 21 12:38:21 2008 +0000
    44.2 +++ b/src/video/fbcon/SDL_fbriva.c	Wed Aug 27 04:23:38 2008 +0000
    44.3 @@ -40,6 +40,7 @@
    44.4      while ((*port & 0x08));
    44.5      while (!(*port & 0x08));
    44.6  }
    44.7 +
    44.8  static void
    44.9  NV3WaitIdle(_THIS)
   44.10  {
   44.11 @@ -47,6 +48,7 @@
   44.12      while ((Rop->FifoFree < FifoEmptyCount) ||
   44.13             (*(mapped_io + PGRAPH_OFFSET + 0x000006B0) & 0x01));
   44.14  }
   44.15 +
   44.16  static void
   44.17  NV4WaitIdle(_THIS)
   44.18  {
    45.1 --- a/src/video/fbcon/SDL_fbvideo.c	Thu Aug 21 12:38:21 2008 +0000
    45.2 +++ b/src/video/fbcon/SDL_fbvideo.c	Wed Aug 27 04:23:38 2008 +0000
    45.3 @@ -82,6 +82,7 @@
    45.4      {0, 0, 320, 240},
    45.5      {0, 0, 320, 200}
    45.6  };
    45.7 +
    45.8  static const struct
    45.9  {
   45.10      int xres;
   45.11 @@ -822,6 +823,7 @@
   45.12      fprintf(stderr, "\talpha: %d/%d\n", vinfo->transp.length,
   45.13              vinfo->transp.offset);
   45.14  }
   45.15 +
   45.16  static void
   45.17  print_finfo(struct fb_fix_screeninfo *finfo)
   45.18  {
   45.19 @@ -1189,6 +1191,7 @@
   45.20      screen->hwdata = (struct private_hwdata *) &surfaces;
   45.21      return (0);
   45.22  }
   45.23 +
   45.24  static void
   45.25  FB_FreeHWSurfaces(_THIS)
   45.26  {
   45.27 @@ -1279,6 +1282,7 @@
   45.28      surface->hwdata = (struct private_hwdata *) bucket;
   45.29      return (0);
   45.30  }
   45.31 +
   45.32  static void
   45.33  FB_FreeHWSurface(_THIS, SDL_Surface * surface)
   45.34  {
   45.35 @@ -1348,6 +1352,7 @@
   45.36      }
   45.37      return (0);
   45.38  }
   45.39 +
   45.40  static void
   45.41  FB_UnlockHWSurface(_THIS, SDL_Surface * surface)
   45.42  {
    46.1 --- a/src/video/gapi/SDL_gapivideo.c	Thu Aug 21 12:38:21 2008 +0000
    46.2 +++ b/src/video/gapi/SDL_gapivideo.c	Wed Aug 27 04:23:38 2008 +0000
    46.3 @@ -340,8 +340,7 @@
    46.4                                                              gx.GXSuspend,
    46.5                                                              "?GXSuspend@@YAHXZ")
    46.6          LINK(GXResume, gx.GXResume, "?GXResume@@YAHXZ") LINK(GXSetViewport,
    46.7 -                                                             gx.
    46.8 -                                                             GXSetViewport,
    46.9 +                                                             gx.GXSetViewport,
   46.10                                                               "?GXSetViewport@@YAHKKKK@Z")
   46.11          LINK(GXIsDisplayDRAMBuffer, gx.GXIsDisplayDRAMBuffer,
   46.12               "?GXIsDisplayDRAMBuffer@@YAHXZ")
   46.13 @@ -807,6 +806,7 @@
   46.14  {
   46.15      return (-1);
   46.16  }
   46.17 +
   46.18  static void
   46.19  GAPI_FreeHWSurface(_THIS, SDL_Surface * surface)
   46.20  {
    47.1 --- a/src/video/ipod/SDL_ipodvideo.c	Thu Aug 21 12:38:21 2008 +0000
    47.2 +++ b/src/video/ipod/SDL_ipodvideo.c	Wed Aug 27 04:23:38 2008 +0000
    47.3 @@ -682,6 +682,7 @@
    47.4          } while (C_timer_check(start, 1000) == 0);
    47.5      }
    47.6  }
    47.7 +
    47.8  static void
    47.9  C_lcd_cmd_data(int cmd, int data)
   47.10  {
   47.11 @@ -776,11 +777,13 @@
   47.12                          ~(3 << (2 * (x % 4)));
   47.13                      ipod_scr[y * (lcd_width / 4) + x / 4] |=
   47.14                          (((Uint8 *) (SDL_VideoSurface->pixels))[y *
   47.15 -                                                                SDL_VideoSurface->
   47.16 -                                                                pitch
   47.17 +                                                                SDL_VideoSurface->pitch
   47.18                                                                  +
   47.19 -                                                                x] &
   47.20 -                         3) << (2 * (x % 4));
   47.21 +                                                                x] & 3) << (2
   47.22 +                                                                            *
   47.23 +                                                                            (x
   47.24 +                                                                             %
   47.25 +                                                                             4));
   47.26                  }
   47.27              }
   47.28          }
    48.1 --- a/src/video/nds/SDL_ndsevents.c	Thu Aug 21 12:38:21 2008 +0000
    48.2 +++ b/src/video/nds/SDL_ndsevents.c	Wed Aug 27 04:23:38 2008 +0000
    48.3 @@ -40,12 +40,12 @@
    48.4  {
    48.5      scanKeys();
    48.6      /* TODO: defer click-age */
    48.7 -    if(keysDown() & KEY_TOUCH) {
    48.8 +    if (keysDown() & KEY_TOUCH) {
    48.9          SDL_SendMouseButton(0, SDL_PRESSED, 0);
   48.10 -    } else if(keysUp() & KEY_TOUCH) {
   48.11 +    } else if (keysUp() & KEY_TOUCH) {
   48.12          SDL_SendMouseButton(0, SDL_RELEASED, 0);
   48.13      }
   48.14 -    if(keysHeld() & KEY_TOUCH) {
   48.15 +    if (keysHeld() & KEY_TOUCH) {
   48.16          touchPosition t = touchReadXY();
   48.17          SDL_SendMouseMotion(0, 0, t.px, t.py);
   48.18      }
    49.1 --- a/src/video/nds/SDL_ndsrender.c	Thu Aug 21 12:38:21 2008 +0000
    49.2 +++ b/src/video/nds/SDL_ndsrender.c	Wed Aug 27 04:23:38 2008 +0000
    49.3 @@ -34,23 +34,20 @@
    49.4  #include "../SDL_yuv_sw_c.h"
    49.5  #include "../SDL_renderer_sw.h"
    49.6  
    49.7 -#define TRACE
    49.8 -//#define TRACE printf
    49.9 -
   49.10  /* NDS sprite-related functions */
   49.11  #define SPRITE_DMA_CHANNEL 3
   49.12  #define SPRITE_ANGLE_MASK 0x01FF
   49.13  
   49.14  void
   49.15 -NDS_OAM_Update(tOAM *oam, int sub)
   49.16 +NDS_OAM_Update(tOAM * oam, int sub)
   49.17  {
   49.18      DC_FlushAll();
   49.19 -    dmaCopyHalfWords(SPRITE_DMA_CHANNEL, oam->spriteBuffer, sub?OAM_SUB:OAM,
   49.20 -                     SPRITE_COUNT * sizeof(SpriteEntry));
   49.21 +    dmaCopyHalfWords(SPRITE_DMA_CHANNEL, oam->spriteBuffer,
   49.22 +                     sub ? OAM_SUB : OAM, SPRITE_COUNT * sizeof(SpriteEntry));
   49.23  }
   49.24  
   49.25  void
   49.26 -NDS_OAM_RotateSprite(SpriteRotation *spriteRotation, u16 angle)
   49.27 +NDS_OAM_RotateSprite(SpriteRotation * spriteRotation, u16 angle)
   49.28  {
   49.29      s16 s = SIN[angle & SPRITE_ANGLE_MASK] >> 4;
   49.30      s16 c = COS[angle & SPRITE_ANGLE_MASK] >> 4;
   49.31 @@ -62,15 +59,15 @@
   49.32  }
   49.33  
   49.34  void
   49.35 -NDS_OAM_Init(tOAM *oam, int sub)
   49.36 +NDS_OAM_Init(tOAM * oam, int sub)
   49.37  {
   49.38      int i;
   49.39 -    for(i = 0; i < SPRITE_COUNT; i++) {
   49.40 +    for (i = 0; i < SPRITE_COUNT; i++) {
   49.41          oam->spriteBuffer[i].attribute[0] = ATTR0_DISABLED;
   49.42          oam->spriteBuffer[i].attribute[1] = 0;
   49.43          oam->spriteBuffer[i].attribute[2] = 0;
   49.44      }
   49.45 -    for(i = 0; i < MATRIX_COUNT; i++) {
   49.46 +    for (i = 0; i < MATRIX_COUNT; i++) {
   49.47          NDS_OAM_RotateSprite(&(oam->matrixBuffer[i]), 0);
   49.48      }
   49.49      swiWaitForVBlank();
   49.50 @@ -78,14 +75,14 @@
   49.51  }
   49.52  
   49.53  void
   49.54 -NDS_OAM_HideSprite(SpriteEntry *spriteEntry)
   49.55 +NDS_OAM_HideSprite(SpriteEntry * spriteEntry)
   49.56  {
   49.57      spriteEntry->isRotoscale = 0;
   49.58      spriteEntry->isHidden = 1;
   49.59  }
   49.60  
   49.61  void
   49.62 -NDS_OAM_ShowSprite(SpriteEntry *spriteEntry, int affine, int double_bound)
   49.63 +NDS_OAM_ShowSprite(SpriteEntry * spriteEntry, int affine, int double_bound)
   49.64  {
   49.65      if (affine) {
   49.66          spriteEntry->isRotoscale = 1;
   49.67 @@ -103,85 +100,83 @@
   49.68  static int NDS_DisplayModeChanged(SDL_Renderer * renderer);
   49.69  static int NDS_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
   49.70  static int NDS_QueryTexturePixels(SDL_Renderer * renderer,
   49.71 -                                 SDL_Texture * texture, void **pixels,
   49.72 -                                 int *pitch);
   49.73 +                                  SDL_Texture * texture, void **pixels,
   49.74 +                                  int *pitch);
   49.75  static int NDS_SetTexturePalette(SDL_Renderer * renderer,
   49.76 -                                SDL_Texture * texture,
   49.77 -                                const SDL_Color * colors, int firstcolor,
   49.78 -                                int ncolors);
   49.79 +                                 SDL_Texture * texture,
   49.80 +                                 const SDL_Color * colors, int firstcolor,
   49.81 +                                 int ncolors);
   49.82  static int NDS_GetTexturePalette(SDL_Renderer * renderer,
   49.83 -                                SDL_Texture * texture, SDL_Color * colors,
   49.84 -                                int firstcolor, int ncolors);
   49.85 +                                 SDL_Texture * texture, SDL_Color * colors,
   49.86 +                                 int firstcolor, int ncolors);
   49.87  static int NDS_SetTextureColorMod(SDL_Renderer * renderer,
   49.88 -                                 SDL_Texture * texture);
   49.89 +                                  SDL_Texture * texture);
   49.90  static int NDS_SetTextureAlphaMod(SDL_Renderer * renderer,
   49.91 -                                 SDL_Texture * texture);
   49.92 +                                  SDL_Texture * texture);
   49.93  static int NDS_SetTextureBlendMode(SDL_Renderer * renderer,
   49.94 -                                  SDL_Texture * texture);
   49.95 +                                   SDL_Texture * texture);
   49.96  static int NDS_SetTextureScaleMode(SDL_Renderer * renderer,
   49.97 -                                  SDL_Texture * texture);
   49.98 +                                   SDL_Texture * texture);
   49.99  static int NDS_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
  49.100 -                          const SDL_Rect * rect, const void *pixels,
  49.101 -                          int pitch);
  49.102 +                             const SDL_Rect * rect, const void *pixels,
  49.103 +                             int pitch);
  49.104  static int NDS_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
  49.105 -                          const SDL_Rect * rect, int markDirty, void **pixels,
  49.106 -                          int *pitch);
  49.107 +                           const SDL_Rect * rect, int markDirty,
  49.108 +                           void **pixels, int *pitch);
  49.109  static void NDS_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
  49.110  static void NDS_DirtyTexture(SDL_Renderer * renderer,
  49.111 -                            SDL_Texture * texture, int numrects,
  49.112 -                            const SDL_Rect * rects);
  49.113 +                             SDL_Texture * texture, int numrects,
  49.114 +                             const SDL_Rect * rects);
  49.115  static int NDS_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g,
  49.116 -                              Uint8 b, Uint8 a, const SDL_Rect * rect);
  49.117 +                          Uint8 b, Uint8 a, const SDL_Rect * rect);
  49.118  static int NDS_RenderCopy(SDL_Renderer * renderer,
  49.119 -                              SDL_Texture * texture,
  49.120 -                              const SDL_Rect * srcrect,
  49.121 -                              const SDL_Rect * dstrect);
  49.122 +                          SDL_Texture * texture,
  49.123 +                          const SDL_Rect * srcrect, const SDL_Rect * dstrect);
  49.124  static void NDS_RenderPresent(SDL_Renderer * renderer);
  49.125 -static void NDS_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture);
  49.126 +static void NDS_DestroyTexture(SDL_Renderer * renderer,
  49.127 +                               SDL_Texture * texture);
  49.128  static void NDS_DestroyRenderer(SDL_Renderer * renderer);
  49.129  
  49.130  
  49.131  SDL_RenderDriver NDS_RenderDriver = {
  49.132      NDS_CreateRenderer,
  49.133 -    {   "nds", /* char* name */
  49.134 -        (SDL_RENDERER_SINGLEBUFFER |
  49.135 -         SDL_RENDERER_ACCELERATED |
  49.136 -         SDL_RENDERER_PRESENTDISCARD |
  49.137 -         SDL_RENDERER_PRESENTVSYNC), /* u32 flags */
  49.138 -        (SDL_TEXTUREMODULATE_NONE), /* u32 mod_modes */
  49.139 -        (SDL_TEXTUREBLENDMODE_MASK), /* u32 blend_modes */
  49.140 -        (SDL_TEXTURESCALEMODE_FAST), /* u32 scale_modes */
  49.141 -        3, /* u32 num_texture_formats */
  49.142 -        {
  49.143 -            SDL_PIXELFORMAT_INDEX8,
  49.144 -            SDL_PIXELFORMAT_ABGR1555,
  49.145 -            SDL_PIXELFORMAT_BGR555,
  49.146 -        }, /* u32 texture_formats[20] */
  49.147 -        (256), /* int max_texture_width */
  49.148 -        (256), /* int max_texture_height */
  49.149 -    }
  49.150 +    {"nds",                     /* char* name */
  49.151 +     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC),  /* u32 flags */
  49.152 +     (SDL_TEXTUREMODULATE_NONE),        /* u32 mod_modes */
  49.153 +     (SDL_TEXTUREBLENDMODE_MASK),       /* u32 blend_modes */
  49.154 +     (SDL_TEXTURESCALEMODE_FAST),       /* u32 scale_modes */
  49.155 +     3,                         /* u32 num_texture_formats */
  49.156 +     {
  49.157 +      SDL_PIXELFORMAT_INDEX8,
  49.158 +      SDL_PIXELFORMAT_ABGR1555,
  49.159 +      SDL_PIXELFORMAT_BGR555,
  49.160 +      },                        /* u32 texture_formats[20] */
  49.161 +     (256),                     /* int max_texture_width */
  49.162 +     (256),                     /* int max_texture_height */
  49.163 +     }
  49.164  };
  49.165  
  49.166  typedef struct
  49.167  {
  49.168 -    bg_attribute *bg; /* backgrounds */
  49.169 -    tOAM oam_copy; /* sprites */
  49.170 +    bg_attribute *bg;           /* backgrounds */
  49.171 +    tOAM oam_copy;              /* sprites */
  49.172      u8 bg_taken[4];
  49.173      int sub;
  49.174  } NDS_RenderData;
  49.175  
  49.176  typedef struct
  49.177  {
  49.178 -    enum { NDSTX_BG, NDSTX_SPR } type; /* represented in a bg or sprite. */
  49.179 -    int hw_index; /* sprite: index in the OAM. /  bg: 2 or 3. */
  49.180 +    enum
  49.181 +    { NDSTX_BG, NDSTX_SPR } type;       /* represented in a bg or sprite. */
  49.182 +    int hw_index;               /* sprite: index in the OAM. /  bg: 2 or 3. */
  49.183      struct
  49.184      {
  49.185          int hdx, hdy, vdx, vdy; /* affine transformation, used for scaling. */
  49.186 -        int pitch, bpp; /* some useful info */
  49.187 +        int pitch, bpp;         /* some useful info */
  49.188      } dim;
  49.189 -    u16 *vram_pixels; /* where the pixel data is stored (a pointer into VRAM) */
  49.190 -    u16 *vram_palette; /* where the palette data is stored if it's indexed.*/
  49.191 -    /*int size;*/
  49.192 +    u16 *vram_pixels;           /* where the pixel data is stored (a pointer into VRAM) */
  49.193 +    u16 *vram_palette;          /* where the palette data is stored if it's indexed. */
  49.194 +    /*int size; */
  49.195  } NDS_TextureData;
  49.196  
  49.197  
  49.198 @@ -197,26 +192,25 @@
  49.199      int bpp;
  49.200      Uint32 Rmask, Gmask, Bmask, Amask;
  49.201  
  49.202 -    TRACE("+NDS_CreateRenderer\n");
  49.203      if (!SDL_PixelFormatEnumToMasks(displayMode->format, &bpp,
  49.204                                      &Rmask, &Gmask, &Bmask, &Amask)) {
  49.205          SDL_SetError("Unknown display format");
  49.206          return NULL;
  49.207      }
  49.208 -    switch(displayMode->format) {
  49.209 -        case SDL_PIXELFORMAT_INDEX8:
  49.210 -        case SDL_PIXELFORMAT_ABGR1555:
  49.211 -        case SDL_PIXELFORMAT_BGR555:
  49.212 -            /* okay */
  49.213 -            break;
  49.214 -        case SDL_PIXELFORMAT_RGB555:
  49.215 -        case SDL_PIXELFORMAT_RGB565:
  49.216 -        case SDL_PIXELFORMAT_ARGB1555:
  49.217 -            /* we'll take these too for now */
  49.218 -            break;
  49.219 -        default:
  49.220 -            printf("DEBUG: wrong display format!\n");
  49.221 -            break;
  49.222 +    switch (displayMode->format) {
  49.223 +    case SDL_PIXELFORMAT_INDEX8:
  49.224 +    case SDL_PIXELFORMAT_ABGR1555:
  49.225 +    case SDL_PIXELFORMAT_BGR555:
  49.226 +        /* okay */
  49.227 +        break;
  49.228 +    case SDL_PIXELFORMAT_RGB555:
  49.229 +    case SDL_PIXELFORMAT_RGB565:
  49.230 +    case SDL_PIXELFORMAT_ARGB1555:
  49.231 +        /* we'll take these too for now */
  49.232 +        break;
  49.233 +    default:
  49.234 +        SDL_SetError("Warning: wrong display format for NDS!\n");
  49.235 +        break;
  49.236      }
  49.237  
  49.238      renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
  49.239 @@ -268,10 +262,10 @@
  49.240      renderer->info.max_texture_height =
  49.241          NDS_RenderDriver.info.max_texture_height;
  49.242  
  49.243 -    data->sub = 0; /* TODO: this is hard-coded to the "main" screen.
  49.244 -                            figure out how to detect whether to set it to
  49.245 -                            "sub" screen.  window->id, perhaps? */
  49.246 -    if(!data->sub) {
  49.247 +    data->sub = 0;              /* TODO: this is hard-coded to the "main" screen.
  49.248 +                                   figure out how to detect whether to set it to
  49.249 +                                   "sub" screen.  window->id, perhaps? */
  49.250 +    if (!data->sub) {
  49.251          data->bg = &BACKGROUND;
  49.252      } else {
  49.253          data->bg = &BACKGROUND_SUB;
  49.254 @@ -280,7 +274,6 @@
  49.255  
  49.256      NDS_OAM_Init(&(data->oam_copy), data->sub); /* init sprites. */
  49.257  
  49.258 -    TRACE("-NDS_CreateRenderer\n");
  49.259      return renderer;
  49.260  }
  49.261  
  49.262 @@ -288,7 +281,7 @@
  49.263  NDS_ActivateRenderer(SDL_Renderer * renderer)
  49.264  {
  49.265      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
  49.266 -    TRACE("!NDS_ActivateRenderer\n");
  49.267 +
  49.268      return 0;
  49.269  }
  49.270  
  49.271 @@ -296,7 +289,7 @@
  49.272  NDS_DisplayModeChanged(SDL_Renderer * renderer)
  49.273  {
  49.274      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
  49.275 -    TRACE("!NDS_DisplayModeChanged\n");
  49.276 +
  49.277      return 0;
  49.278  }
  49.279  
  49.280 @@ -309,7 +302,6 @@
  49.281      int bpp;
  49.282      Uint32 Rmask, Gmask, Bmask, Amask;
  49.283  
  49.284 -    TRACE("+NDS_CreateTexture\n");
  49.285      if (!SDL_PixelFormatEnumToMasks
  49.286          (texture->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
  49.287          SDL_SetError("Unknown texture format");
  49.288 @@ -318,44 +310,45 @@
  49.289  
  49.290      /* conditional statements on w/h to place it as bg/sprite
  49.291         depending on which one it fits. */
  49.292 -    if(texture->w <= 64 && texture->h <= 64) {
  49.293 +    if (texture->w <= 64 && texture->h <= 64) {
  49.294          int whichspr = -1;
  49.295          printf("Tried to make a sprite.\n");
  49.296          txdat->type = NDSTX_SPR;
  49.297 -        for(i = 0; i < SPRITE_COUNT; ++i) {
  49.298 -            if(data->oam_copy.spriteBuffer[i].attribute[0] & ATTR0_DISABLED) {
  49.299 +        for (i = 0; i < SPRITE_COUNT; ++i) {
  49.300 +            if (data->oam_copy.spriteBuffer[i].attribute[0] & ATTR0_DISABLED) {
  49.301                  whichspr = i;
  49.302                  break;
  49.303              }
  49.304          }
  49.305 -        if(whichspr >= 0) {
  49.306 +        if (whichspr >= 0) {
  49.307              SpriteEntry *sprent = &(data->oam_copy.spriteBuffer[whichspr]);
  49.308              int maxside = texture->w > texture->h ? texture->w : texture->h;
  49.309              int pitch;
  49.310  
  49.311              texture->driverdata = SDL_calloc(1, sizeof(NDS_TextureData));
  49.312 -            txdat = (NDS_TextureData*)texture->driverdata;
  49.313 -            if(!txdat) {
  49.314 +            txdat = (NDS_TextureData *) texture->driverdata;
  49.315 +            if (!txdat) {
  49.316                  SDL_OutOfMemory();
  49.317                  return -1;
  49.318              }
  49.319  
  49.320              sprent->objMode = OBJMODE_BITMAP;
  49.321 -            sprent->posX = 0; sprent->posY = 0;
  49.322 -            sprent->colMode = OBJCOLOR_16; /* OBJCOLOR_256 for INDEX8 */
  49.323 +            sprent->posX = 0;
  49.324 +            sprent->posY = 0;
  49.325 +            sprent->colMode = OBJCOLOR_16;      /* OBJCOLOR_256 for INDEX8 */
  49.326  
  49.327              /* the first 32 sprites get transformation matrices.
  49.328                 first come, first served */
  49.329 -            if(whichspr < MATRIX_COUNT) {
  49.330 +            if (whichspr < MATRIX_COUNT) {
  49.331                  sprent->isRotoscale = 1;
  49.332                  sprent->rsMatrixIdx = whichspr;
  49.333              }
  49.334  
  49.335              /* containing shape (square or 2:1 rectangles) */
  49.336              sprent->objShape = OBJSHAPE_SQUARE;
  49.337 -            if(texture->w/2 >= texture->h) {
  49.338 +            if (texture->w / 2 >= texture->h) {
  49.339                  sprent->objShape = OBJSHAPE_WIDE;
  49.340 -            } else if(texture->h/2 >= texture->w) {
  49.341 +            } else if (texture->h / 2 >= texture->w) {
  49.342                  sprent->objShape = OBJSHAPE_TALL;
  49.343              }
  49.344  
  49.345 @@ -363,13 +356,13 @@
  49.346              /* FIXME: "pitch" is hardcoded for 2bytes per pixel. */
  49.347              sprent->objSize = OBJSIZE_64;
  49.348              pitch = 128;
  49.349 -            if(maxside <= 8) {
  49.350 +            if (maxside <= 8) {
  49.351                  sprent->objSize = OBJSIZE_8;
  49.352                  pitch = 16;
  49.353 -            } else if(maxside <= 16) {
  49.354 +            } else if (maxside <= 16) {
  49.355                  sprent->objSize = OBJSIZE_16;
  49.356                  pitch = 32;
  49.357 -            } else if(maxside <= 32) {
  49.358 +            } else if (maxside <= 32) {
  49.359                  sprent->objSize = OBJSIZE_32;
  49.360                  pitch = 64;
  49.361              }
  49.362 @@ -382,28 +375,29 @@
  49.363              /* now for the texture data */
  49.364              txdat->type = NDSTX_SPR;
  49.365              txdat->hw_index = whichspr;
  49.366 -            txdat->dim.hdx = 0x100; txdat->dim.hdy = 0;
  49.367 -            txdat->dim.vdx = 0;     txdat->dim.vdy = 0x100;
  49.368 +            txdat->dim.hdx = 0x100;
  49.369 +            txdat->dim.hdy = 0;
  49.370 +            txdat->dim.vdx = 0;
  49.371 +            txdat->dim.vdy = 0x100;
  49.372              txdat->dim.pitch = pitch;
  49.373              txdat->dim.bpp = bpp;
  49.374 -            txdat->vram_pixels = (u16*)(data->sub ?
  49.375 -                SPRITE_GFX_SUB : SPRITE_GFX); /* FIXME: use tileIdx*boundary
  49.376 -                                                 to point to proper location */
  49.377 +            txdat->vram_pixels = (u16 *) (data->sub ? SPRITE_GFX_SUB : SPRITE_GFX);     /* FIXME: use tileIdx*boundary
  49.378 +                                                                                           to point to proper location */
  49.379          } else {
  49.380              SDL_SetError("Out of NDS sprites.");
  49.381          }
  49.382 -    } else if(texture->w <= 256 && texture->h <= 256) {
  49.383 +    } else if (texture->w <= 256 && texture->h <= 256) {
  49.384          int whichbg = -1, base = 0;
  49.385 -        if(!data->bg_taken[2]) {
  49.386 +        if (!data->bg_taken[2]) {
  49.387              whichbg = 2;
  49.388 -        } else if(!data->bg_taken[3]) {
  49.389 +        } else if (!data->bg_taken[3]) {
  49.390              whichbg = 3;
  49.391              base = 4;
  49.392          }
  49.393 -        if(whichbg >= 0) {
  49.394 +        if (whichbg >= 0) {
  49.395              texture->driverdata = SDL_calloc(1, sizeof(NDS_TextureData));
  49.396 -            txdat = (NDS_TextureData*)texture->driverdata;
  49.397 -            if(!txdat) {
  49.398 +            txdat = (NDS_TextureData *) texture->driverdata;
  49.399 +            if (!txdat) {
  49.400                  SDL_OutOfMemory();
  49.401                  return -1;
  49.402              }
  49.403 @@ -419,14 +413,17 @@
  49.404  
  49.405              txdat->type = NDSTX_BG;
  49.406              txdat->hw_index = whichbg;
  49.407 -            txdat->dim.hdx = 0x100; txdat->dim.hdy = 0;
  49.408 -            txdat->dim.vdx = 0;     txdat->dim.vdy = 0x100;
  49.409 +            txdat->dim.hdx = 0x100;
  49.410 +            txdat->dim.hdy = 0;
  49.411 +            txdat->dim.vdx = 0;
  49.412 +            txdat->dim.vdy = 0x100;
  49.413              txdat->dim.pitch = 512;
  49.414              txdat->dim.bpp = bpp;
  49.415 -            txdat->vram_pixels = (u16*)(data->sub ?
  49.416 -                BG_BMP_RAM_SUB(base) : BG_BMP_RAM(base));
  49.417 +            txdat->vram_pixels = (u16 *) (data->sub ?
  49.418 +                                          BG_BMP_RAM_SUB(base) :
  49.419 +                                          BG_BMP_RAM(base));
  49.420  
  49.421 -            /*txdat->size = txdat->dim.pitch * texture->h;*/
  49.422 +            /*txdat->size = txdat->dim.pitch * texture->h; */
  49.423          } else {
  49.424              SDL_SetError("Out of NDS backgrounds.");
  49.425          }
  49.426 @@ -434,7 +431,6 @@
  49.427          SDL_SetError("Texture too big for NDS hardware.");
  49.428      }
  49.429  
  49.430 -    TRACE("-NDS_CreateTexture\n");
  49.431      if (!texture->driverdata) {
  49.432          return -1;
  49.433      }
  49.434 @@ -444,35 +440,33 @@
  49.435  
  49.436  static int
  49.437  NDS_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
  49.438 -                      void **pixels, int *pitch)
  49.439 +                       void **pixels, int *pitch)
  49.440  {
  49.441      NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
  49.442 -    TRACE("+NDS_QueryTexturePixels\n");
  49.443      *pixels = txdat->vram_pixels;
  49.444      *pitch = txdat->dim.pitch;
  49.445 -    TRACE("-NDS_QueryTexturePixels\n");
  49.446      return 0;
  49.447  }
  49.448  
  49.449  static int
  49.450  NDS_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
  49.451 -                 const SDL_Rect * rect, const void *pixels, int pitch)
  49.452 +                  const SDL_Rect * rect, const void *pixels, int pitch)
  49.453  {
  49.454      NDS_TextureData *txdat;
  49.455      Uint8 *src, *dst;
  49.456 -    int row; size_t length;
  49.457 -    TRACE("+NDS_UpdateTexture\n");
  49.458 +    int row;
  49.459 +    size_t length;
  49.460  
  49.461      txdat = (NDS_TextureData *) texture->driverdata;
  49.462  
  49.463      src = (Uint8 *) pixels;
  49.464      dst =
  49.465          (Uint8 *) txdat->vram_pixels + rect->y * txdat->dim.pitch +
  49.466 -        rect->x * ((txdat->dim.bpp+1)/8);
  49.467 -    length = rect->w * ((txdat->dim.bpp+1)/8);
  49.468 +        rect->x * ((txdat->dim.bpp + 1) / 8);
  49.469 +    length = rect->w * ((txdat->dim.bpp + 1) / 8);
  49.470  
  49.471 -    if(rect->w == texture->w) {
  49.472 -        dmaCopy(src, dst, length*rect->h);
  49.473 +    if (rect->w == texture->w) {
  49.474 +        dmaCopy(src, dst, length * rect->h);
  49.475      } else {
  49.476          for (row = 0; row < rect->h; ++row) {
  49.477              dmaCopy(src, dst, length);
  49.478 @@ -481,68 +475,62 @@
  49.479          }
  49.480      }
  49.481  
  49.482 -    TRACE("-NDS_UpdateTexture\n");
  49.483      return 0;
  49.484  }
  49.485  
  49.486  static int
  49.487  NDS_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
  49.488 -               const SDL_Rect * rect, int markDirty, void **pixels,
  49.489 -               int *pitch)
  49.490 +                const SDL_Rect * rect, int markDirty, void **pixels,
  49.491 +                int *pitch)
  49.492  {
  49.493      NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
  49.494 -    TRACE("+NDS_LockTexture\n");
  49.495  
  49.496 -    *pixels = (void *) ((u8 *)txdat->vram_pixels + rect->y
  49.497 -                        * txdat->dim.pitch + rect->x * ((txdat->dim.bpp+1)/8));
  49.498 +    *pixels = (void *) ((u8 *) txdat->vram_pixels + rect->y
  49.499 +                        * txdat->dim.pitch +
  49.500 +                        rect->x * ((txdat->dim.bpp + 1) / 8));
  49.501      *pitch = txdat->dim.pitch;
  49.502  
  49.503 -    TRACE("-NDS_LockTexture\n");
  49.504      return 0;
  49.505  }
  49.506  
  49.507  static void
  49.508  NDS_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
  49.509  {
  49.510 -    TRACE("+NDS_UnlockTexture\n");
  49.511 -    TRACE("-NDS_UnlockTexture\n");
  49.512 +    /* stub! */
  49.513  }
  49.514  
  49.515  static void
  49.516  NDS_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
  49.517 -                int numrects, const SDL_Rect * rects)
  49.518 +                 int numrects, const SDL_Rect * rects)
  49.519  {
  49.520 -    /* stub */
  49.521 -    TRACE("!NDS_DirtyTexture\n");
  49.522 +    /* stub! */
  49.523  }
  49.524  
  49.525  static int
  49.526  NDS_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b,
  49.527 -                   Uint8 a, const SDL_Rect * rect)
  49.528 +               Uint8 a, const SDL_Rect * rect)
  49.529  {
  49.530      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
  49.531      SDL_Rect real_rect = *rect;
  49.532      u16 color;
  49.533      int i, j;
  49.534  
  49.535 -    TRACE("+NDS_RenderFill\n");
  49.536 -    color = RGB8(r,g,b); /* <-- macro in libnds that makes an ARGB1555 pixel */
  49.537 +    color = RGB8(r, g, b);      /* <-- macro in libnds that makes an ARGB1555 pixel */
  49.538      /* TODO: make a single-color sprite and stretch it.
  49.539         calculate the "HDX" width modifier of the sprite by:
  49.540 -         let S be the actual sprite's width (like, 32 pixels for example)
  49.541 -         let R be the rectangle's width (maybe 50 pixels)
  49.542 -         HDX = (R<<8) / S;
  49.543 -         (it's fixed point, hence the bit shift.  same goes for vertical.
  49.544 -         be sure to use 32-bit int's for the bit shift before the division!)
  49.545 +       let S be the actual sprite's width (like, 32 pixels for example)
  49.546 +       let R be the rectangle's width (maybe 50 pixels)
  49.547 +       HDX = (R<<8) / S;
  49.548 +       (it's fixed point, hence the bit shift.  same goes for vertical.
  49.549 +       be sure to use 32-bit int's for the bit shift before the division!)
  49.550       */
  49.551  
  49.552 -    TRACE("-NDS_RenderFill\n");
  49.553      return 0;
  49.554  }
  49.555  
  49.556  static int
  49.557  NDS_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
  49.558 -                   const SDL_Rect * srcrect, const SDL_Rect * dstrect)
  49.559 +               const SDL_Rect * srcrect, const SDL_Rect * dstrect)
  49.560  {
  49.561      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
  49.562      NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
  49.563 @@ -552,8 +540,7 @@
  49.564      int bpp = SDL_BYTESPERPIXEL(texture->format);
  49.565      int pitch = txdat->dim.pitch;
  49.566  
  49.567 -    TRACE("+NDS_RenderCopy\n");
  49.568 -    if(txdat->type == NDSTX_BG) {
  49.569 +    if (txdat->type == NDSTX_BG) {
  49.570          bg_rotation *bgrot = (txdat->hw_index == 2) ?
  49.571              &(data->bg->bg2_rotation) : &(data->bg->bg3_rotation);
  49.572          bgrot->xdx = txdat->dim.hdx;
  49.573 @@ -570,16 +557,15 @@
  49.574          SpriteEntry *spr = &(data->oam_copy.spriteBuffer[txdat->hw_index]);
  49.575          spr->posX = dstrect->x;
  49.576          spr->posY = dstrect->y;
  49.577 -        if(txdat->hw_index < MATRIX_COUNT && spr->isRotoscale) {
  49.578 -            SpriteRotation *sprot = &(data->oam_copy.matrixBuffer[txdat->hw_index]);
  49.579 +        if (txdat->hw_index < MATRIX_COUNT && spr->isRotoscale) {
  49.580 +            SpriteRotation *sprot =
  49.581 +                &(data->oam_copy.matrixBuffer[txdat->hw_index]);
  49.582              sprot->hdx = txdat->dim.hdx;
  49.583              sprot->hdy = txdat->dim.hdy;
  49.584              sprot->vdx = txdat->dim.vdx;
  49.585              sprot->vdy = txdat->dim.vdy;
  49.586          }
  49.587 -        printf("tried to RenderCopy a sprite.\n");
  49.588      }
  49.589 -    TRACE("-NDS_RenderCopy\n");
  49.590  
  49.591      return 0;
  49.592  }
  49.593 @@ -592,25 +578,20 @@
  49.594      SDL_Window *window = SDL_GetWindowFromID(renderer->window);
  49.595      SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  49.596  
  49.597 -    TRACE("+NDS_RenderPresent\n");
  49.598      /* update sprites */
  49.599      NDS_OAM_Update(&(data->oam_copy), data->sub);
  49.600      /* vsync for NDS */
  49.601      if (renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) {
  49.602          swiWaitForVBlank();
  49.603      }
  49.604 -    TRACE("-NDS_RenderPresent\n");
  49.605  }
  49.606  
  49.607  static void
  49.608  NDS_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
  49.609  {
  49.610      NDS_TextureData *txdat = texture->driverdata;
  49.611 -    TRACE("+NDS_DestroyTexture\n");
  49.612      /* free anything else allocated for texture */
  49.613 -    /*SDL_FreeDirtyRects(&txdat->dirty);*/
  49.614      SDL_free(txdat);
  49.615 -    TRACE("-NDS_DestroyTexture\n");
  49.616  }
  49.617  
  49.618  static void
  49.619 @@ -621,49 +602,36 @@
  49.620      SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  49.621      int i;
  49.622  
  49.623 -    TRACE("+NDS_DestroyRenderer\n");
  49.624      if (data) {
  49.625 -        /* TODO: free anything else relevant. */
  49.626 -        /*if (data->surface.format) {
  49.627 -            SDL_SetSurfacePalette(&data->surface, NULL);
  49.628 -            SDL_FreeFormat(data->surface.format);
  49.629 -        }
  49.630 -        if (display->palette) {
  49.631 -            SDL_DelPaletteWatch(display->palette, DisplayPaletteChanged,
  49.632 -                                data);
  49.633 -        }*/
  49.634 -        /*SDL_FreeDirtyRects(&data->dirty);*/
  49.635 +        /* free anything else relevant if anything else is allocated. */
  49.636          SDL_free(data);
  49.637      }
  49.638      SDL_free(renderer);
  49.639 -    TRACE("-NDS_DestroyRenderer\n");
  49.640  }
  49.641  
  49.642  static int
  49.643  NDS_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
  49.644 -                     const SDL_Color * colors, int firstcolor, int ncolors)
  49.645 +                      const SDL_Color * colors, int firstcolor, int ncolors)
  49.646  {
  49.647      NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
  49.648 -    TRACE("+NDS_SetTexturePalette\n");
  49.649      /* set 8-bit modes in the background control registers
  49.650         for backgrounds, BGn_CR |= BG_256_COLOR */
  49.651 -    TRACE("-NDS_SetTexturePalette\n");
  49.652 +
  49.653      return 0;
  49.654  }
  49.655  
  49.656  static int
  49.657  NDS_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
  49.658 -                     SDL_Color * colors, int firstcolor, int ncolors)
  49.659 +                      SDL_Color * colors, int firstcolor, int ncolors)
  49.660  {
  49.661      NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
  49.662 -    TRACE("!NDS_GetTexturePalette\n");
  49.663 +    /* stub! */
  49.664      return 0;
  49.665  }
  49.666  
  49.667  static int
  49.668  NDS_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture)
  49.669  {
  49.670 -    TRACE("!NDS_SetTextureColorMod\n");
  49.671      /* stub! */
  49.672      return 0;
  49.673  }
  49.674 @@ -671,7 +639,6 @@
  49.675  static int
  49.676  NDS_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture)
  49.677  {
  49.678 -    TRACE("!NDS_SetTextureAlphaMod\n");
  49.679      /* stub! */
  49.680      return 0;
  49.681  }
  49.682 @@ -679,7 +646,6 @@
  49.683  static int
  49.684  NDS_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
  49.685  {
  49.686 -    TRACE("!NDS_SetTextureBlendMode\n");
  49.687      /* stub! */
  49.688      return 0;
  49.689  }
  49.690 @@ -687,7 +653,6 @@
  49.691  static int
  49.692  NDS_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
  49.693  {
  49.694 -    TRACE("!NDS_SetTextureScaleMode\n");
  49.695      /* stub! (note: NDS hardware scaling is nearest neighbor.) */
  49.696      return 0;
  49.697  }
    50.1 --- a/src/video/nds/SDL_ndsvideo.c	Thu Aug 21 12:38:21 2008 +0000
    50.2 +++ b/src/video/nds/SDL_ndsvideo.c	Wed Aug 27 04:23:38 2008 +0000
    50.3 @@ -23,7 +23,7 @@
    50.4  
    50.5  /* SDL Nintendo DS video driver implementation
    50.6   * based on dummy driver:
    50.7 - * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion
    50.8 + *  Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion
    50.9   *  of this was cut-and-pasted from Stephane Peter's work in the AAlib
   50.10   *  SDL video driver.  Renamed to "DUMMY" by Sam Lantinga.
   50.11   */
   50.12 @@ -43,13 +43,6 @@
   50.13  #include "SDL_ndsevents_c.h"
   50.14  #include "SDL_ndsrender_c.h"
   50.15  
   50.16 -
   50.17 -
   50.18 -#define TRACE
   50.19 -//#define TRACE printf
   50.20 -
   50.21 -
   50.22 -
   50.23  #define NDSVID_DRIVER_NAME "nds"
   50.24  
   50.25  /* Initialization/Query functions */
   50.26 @@ -62,9 +55,7 @@
   50.27  static int
   50.28  NDS_Available(void)
   50.29  {
   50.30 -    /*const char *envr = SDL_getenv("SDL_VIDEODRIVER");*/
   50.31 -    /*printf("NDS_Available()\n"); */
   50.32 -    return (1);
   50.33 +    return (1);                 /* always here */
   50.34  }
   50.35  
   50.36  static void
   50.37 @@ -77,9 +68,7 @@
   50.38  NDS_CreateDevice(int devindex)
   50.39  {
   50.40      SDL_VideoDevice *device;
   50.41 -    /*printf("NDS_CreateDevice(%d)\n", devindex); */
   50.42  
   50.43 -    TRACE("+NDS_CreateDevice\n");
   50.44      /* Initialize all variables that we clean on shutdown */
   50.45      device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
   50.46      if (!device) {
   50.47 @@ -100,7 +89,6 @@
   50.48  
   50.49      device->free = NDS_DeleteDevice;
   50.50  
   50.51 -    TRACE("-NDS_CreateDevice\n");
   50.52      return device;
   50.53  }
   50.54  
   50.55 @@ -115,7 +103,6 @@
   50.56      SDL_DisplayMode mode;
   50.57      int i;
   50.58  
   50.59 -    TRACE("+NDS_VideoInit\n");
   50.60      /* simple 256x192x16x60 for now */
   50.61      mode.w = 256;
   50.62      mode.h = 192;
   50.63 @@ -125,62 +112,49 @@
   50.64  
   50.65      SDL_AddBasicVideoDisplay(&mode);
   50.66      SDL_AddRenderDriver(0, &NDS_RenderDriver);
   50.67 -    /*SDL_AddBasicVideoDisplay(&mode); two screens, same mode. uncomment later
   50.68 -    SDL_AddRenderDriver(1, &NDS_RenderDriver);*/
   50.69  
   50.70      SDL_zero(mode);
   50.71      SDL_AddDisplayMode(0, &mode);
   50.72  
   50.73 -    /* hackish stuff to get things up and running for now, and for a console */
   50.74 -    powerON(POWER_ALL_2D);
   50.75     irqInit();
   50.76 -    irqEnable(IRQ_VBLANK);
   50.77 +    powerON(POWER_ALL_2D);
   50.78 +    irqInit();
   50.79 +    irqEnable(IRQ_VBLANK);
   50.80      NDS_SetDisplayMode(_this, &mode);
   50.81  
   50.82 -    TRACE("-NDS_VideoInit\n");
   50.83      return 0;
   50.84  }
   50.85  
   50.86  static int
   50.87  NDS_SetDisplayMode(_THIS, SDL_DisplayMode * mode)
   50.88  {
   50.89 -    TRACE("+NDS_SetDisplayMode\n");
   50.90      /* right now this function is just hard-coded for 256x192 ABGR1555 */
   50.91 -    videoSetMode(MODE_5_2D |
   50.92 -                 DISPLAY_BG2_ACTIVE |
   50.93 -                 DISPLAY_BG3_ACTIVE |
   50.94 -                 DISPLAY_BG_EXT_PALETTE |
   50.95 -                 DISPLAY_SPR_1D_LAYOUT |
   50.96 -                 DISPLAY_SPR_1D_BMP |
   50.97 -                 DISPLAY_SPR_1D_BMP_SIZE_256 | /* try 128 if 256 is trouble. */
   50.98 -                 DISPLAY_SPR_ACTIVE |
   50.99 -                 DISPLAY_SPR_EXT_PALETTE); /* display on main core
  50.100 -                                              with lots of flags set for
  50.101 -                                              flexibility/capacity to render */
  50.102 +    videoSetMode(MODE_5_2D | DISPLAY_BG2_ACTIVE | DISPLAY_BG3_ACTIVE | DISPLAY_BG_EXT_PALETTE | DISPLAY_SPR_1D_LAYOUT | DISPLAY_SPR_1D_BMP | DISPLAY_SPR_1D_BMP_SIZE_256 |      /* (try 128 if 256 is trouble.) */
  50.103 +                 DISPLAY_SPR_ACTIVE | DISPLAY_SPR_EXT_PALETTE); /* display on main core
  50.104 +                                                                   with lots of flags set for
  50.105 +                                                                   flexibility/capacity to render */
  50.106  
  50.107      /* hopefully these cover all the various things we might need to do */
  50.108      vramSetBankA(VRAM_A_MAIN_BG_0x06000000);
  50.109      vramSetBankB(VRAM_B_MAIN_BG_0x06020000);
  50.110      vramSetBankC(VRAM_C_SUB_BG_0x06200000);
  50.111 -    vramSetBankD(VRAM_D_MAIN_BG_0x06040000); /* not a typo. vram d can't sub */
  50.112 +    vramSetBankD(VRAM_D_MAIN_BG_0x06040000);    /* not a typo. vram d can't sub */
  50.113      vramSetBankE(VRAM_E_MAIN_SPRITE);
  50.114      vramSetBankF(VRAM_F_OBJ_EXT_PALETTE);
  50.115      vramSetBankG(VRAM_G_BG_EXT_PALETTE);
  50.116      vramSetBankH(VRAM_H_SUB_BG_EXT_PALETTE);
  50.117      vramSetBankI(VRAM_I_SUB_SPRITE);
  50.118  
  50.119 -    videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); /* debug text on sub
  50.120 -                                                        TODO: this will change
  50.121 -                                                        when multi-head is
  50.122 -                                                        introduced in render */
  50.123 +    videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE);    /* debug text on sub
  50.124 +                                                           TODO: this will change
  50.125 +                                                           when multi-head is
  50.126 +                                                           introduced in render */
  50.127  
  50.128 -    TRACE("-NDS_SetDisplayMode\n");
  50.129      return 0;
  50.130  }
  50.131  
  50.132  void
  50.133  NDS_VideoQuit(_THIS)
  50.134  {
  50.135 -    TRACE("+NDS_VideoQuit\n");
  50.136      videoSetMode(DISPLAY_SCREEN_OFF);
  50.137      videoSetModeSub(DISPLAY_SCREEN_OFF);
  50.138      vramSetMainBanks(VRAM_A_LCD, VRAM_B_LCD, VRAM_C_LCD, VRAM_D_LCD);
  50.139 @@ -189,7 +163,6 @@
  50.140      vramSetBankG(VRAM_G_LCD);
  50.141      vramSetBankH(VRAM_H_LCD);
  50.142      vramSetBankI(VRAM_I_LCD);
  50.143 -    TRACE("-NDS_VideoQuit\n");
  50.144  }
  50.145  
  50.146  /* vi: set ts=4 sw=4 expandtab: */
    51.1 --- a/src/video/os2fslib/SDL_os2fslib.c	Thu Aug 21 12:38:21 2008 +0000
    51.2 +++ b/src/video/os2fslib/SDL_os2fslib.c	Wed Aug 27 04:23:38 2008 +0000
    51.3 @@ -440,8 +440,8 @@
    51.4                      if ((!pVideo->hidden->pSDLSurface) ||
    51.5                          ((pVideo->hidden->pSDLSurface)
    51.6                           &&
    51.7 -                         ((pVideo->hidden->pSDLSurface->
    51.8 -                           flags & SDL_RESIZABLE) == 0)))
    51.9 +                         ((pVideo->hidden->
   51.10 +                           pSDLSurface->flags & SDL_RESIZABLE) == 0)))
   51.11                          FSLib_ToggleFSMode(hwnd, !FSLib_QueryFSMode(hwnd));
   51.12  #ifdef DEBUG_BUILD
   51.13                      else
   51.14 @@ -552,11 +552,11 @@
   51.15                      {
   51.16  
   51.17                          iXScaleError =
   51.18 -                            (pVideo->hidden->SrcBufferDesc.
   51.19 -                             uiXResolution - 1) / swp.cx;
   51.20 +                            (pVideo->hidden->SrcBufferDesc.uiXResolution -
   51.21 +                             1) / swp.cx;
   51.22                          iYScaleError =
   51.23 -                            (pVideo->hidden->SrcBufferDesc.
   51.24 -                             uiYResolution - 1) / swp.cy;
   51.25 +                            (pVideo->hidden->SrcBufferDesc.uiYResolution -
   51.26 +                             1) / swp.cy;
   51.27                          if (iXScaleError < 0)
   51.28                              iXScaleError = 0;
   51.29                          if (iYScaleError < 0)
   51.30 @@ -577,24 +577,22 @@
   51.31                          iTop =
   51.32                              (swp.cy -
   51.33                               rcl.yTop) *
   51.34 -                            pVideo->hidden->SrcBufferDesc.
   51.35 -                            uiYResolution / swp.cy - iYScaleError;
   51.36 +                            pVideo->hidden->SrcBufferDesc.uiYResolution /
   51.37 +                            swp.cy - iYScaleError;
   51.38                          iLeft =
   51.39                              rcl.xLeft *
   51.40 -                            pVideo->hidden->SrcBufferDesc.
   51.41 -                            uiXResolution / swp.cx - iXScaleError;
   51.42 +                            pVideo->hidden->SrcBufferDesc.uiXResolution /
   51.43 +                            swp.cx - iXScaleError;
   51.44                          iWidth =
   51.45                              ((rcl.xRight -
   51.46                                rcl.xLeft) *
   51.47 -                             pVideo->hidden->SrcBufferDesc.
   51.48 -                             uiXResolution + swp.cx - 1) / swp.cx +
   51.49 -                            2 * iXScaleError;
   51.50 +                             pVideo->hidden->SrcBufferDesc.uiXResolution +
   51.51 +                             swp.cx - 1) / swp.cx + 2 * iXScaleError;
   51.52                          iHeight =
   51.53                              ((rcl.yTop -
   51.54                                rcl.yBottom) *
   51.55 -                             pVideo->hidden->SrcBufferDesc.
   51.56 -                             uiYResolution + swp.cy - 1) / swp.cy +
   51.57 -                            2 * iYScaleError;
   51.58 +                             pVideo->hidden->SrcBufferDesc.uiYResolution +
   51.59 +                             swp.cy - 1) / swp.cy + 2 * iYScaleError;
   51.60  
   51.61                          iWidth += iXScaleError2;
   51.62                          iHeight += iYScaleError2;
   51.63 @@ -606,20 +604,19 @@
   51.64                          if (iTop + iHeight >
   51.65                              pVideo->hidden->SrcBufferDesc.uiYResolution)
   51.66                              iHeight =
   51.67 -                                pVideo->hidden->SrcBufferDesc.
   51.68 -                                uiYResolution - iTop;
   51.69 +                                pVideo->hidden->SrcBufferDesc.uiYResolution -
   51.70 +                                iTop;
   51.71                          if (iLeft + iWidth >
   51.72                              pVideo->hidden->SrcBufferDesc.uiXResolution)
   51.73                              iWidth =
   51.74 -                                pVideo->hidden->SrcBufferDesc.
   51.75 -                                uiXResolution - iLeft;
   51.76 +                                pVideo->hidden->SrcBufferDesc.uiXResolution -
   51.77 +                                iLeft;
   51.78  
   51.79  #ifdef DEBUG_BUILD
   51.80                          printf
   51.81                              ("WM_PAINT : BitBlt: %d %d -> %d %d (Buf %d x %d)\n",
   51.82                               iTop, iLeft, iWidth, iHeight,
   51.83 -                             pVideo->hidden->SrcBufferDesc.
   51.84 -                             uiXResolution,
   51.85 +                             pVideo->hidden->SrcBufferDesc.uiXResolution,
   51.86                               pVideo->hidden->SrcBufferDesc.uiYResolution);
   51.87                          fflush(stdout);
   51.88  #endif
   51.89 @@ -693,15 +690,15 @@
   51.90                              WinQueryWindowPos(hwnd, &swp);
   51.91                              if ((!pVideo->hidden->pSDLSurface) ||
   51.92                                  ((pVideo->hidden->pSDLSurface) &&
   51.93 -                                 (pVideo->hidden->pSDLSurface->
   51.94 -                                  flags & SDL_RESIZABLE)
   51.95 +                                 (pVideo->hidden->
   51.96 +                                  pSDLSurface->flags & SDL_RESIZABLE)
   51.97                                   &&
   51.98                                   ((swp.cx !=
   51.99 -                                   pVideo->hidden->SrcBufferDesc.
  51.100 -                                   uiXResolution)
  51.101 +                                   pVideo->hidden->
  51.102 +                                   SrcBufferDesc.uiXResolution)
  51.103                                    || (swp.cy !=
  51.104 -                                      pVideo->hidden->
  51.105 -                                      SrcBufferDesc.uiYResolution))
  51.106 +                                      pVideo->hidden->SrcBufferDesc.
  51.107 +                                      uiYResolution))
  51.108                                   && (!FSLib_QueryFSMode(hwnd)))) {
  51.109                                  // Resizable surface and in resizing!
  51.110                                  // So, don't blit now!
  51.111 @@ -718,14 +715,12 @@
  51.112                                  fflush(stdout);
  51.113  #endif
  51.114                                  FSLIB_BITBLT(hwnd,
  51.115 -                                             pVideo->hidden->
  51.116 -                                             pchSrcBuffer, 0,
  51.117 +                                             pVideo->hidden->pchSrcBuffer, 0,
  51.118                                               0,
  51.119                                               pVideo->hidden->
  51.120 -                                             SrcBufferDesc.
  51.121 -                                             uiXResolution,
  51.122 -                                             pVideo->hidden->
  51.123 -                                             SrcBufferDesc.uiYResolution);
  51.124 +                                             SrcBufferDesc.uiXResolution,
  51.125 +                                             pVideo->hidden->SrcBufferDesc.
  51.126 +                                             uiYResolution);
  51.127                              }
  51.128                          }
  51.129  #ifdef DEBUG_BUILD
  51.130 @@ -773,8 +768,8 @@
  51.131                                            &swpClient);
  51.132                          ptl.x = 0;
  51.133                          ptl.y = 0;
  51.134 -                        WinMapWindowPoints(pVideo->hidden->
  51.135 -                                           hwndClient, HWND_DESKTOP, &ptl, 1);
  51.136 +                        WinMapWindowPoints(pVideo->hidden->hwndClient,
  51.137 +                                           HWND_DESKTOP, &ptl, 1);
  51.138                          pVideo->hidden->iSkipWMMOUSEMOVE++;     /* Don't take next WM_MOUSEMOVE into account!  */
  51.139                          WinSetPointerPos(HWND_DESKTOP,
  51.140                                           ptl.x + swpClient.cx / 2,
  51.141 @@ -825,8 +820,8 @@
  51.142                                            &swpClient);
  51.143                          ptl.x = 0;
  51.144                          ptl.y = 0;
  51.145 -                        WinMapWindowPoints(pVideo->hidden->
  51.146 -                                           hwndClient, HWND_DESKTOP, &ptl, 1);
  51.147 +                        WinMapWindowPoints(pVideo->hidden->hwndClient,
  51.148 +                                           HWND_DESKTOP, &ptl, 1);
  51.149                          pVideo->hidden->iSkipWMMOUSEMOVE++;     /* Don't take next WM_MOUSEMOVE into account!  */
  51.150                          WinSetPointerPos(HWND_DESKTOP,
  51.151                                           ptl.x + swpClient.cx / 2,
  51.152 @@ -867,8 +862,8 @@
  51.153                                            &swpClient);
  51.154                          ptl.x = 0;
  51.155                          ptl.y = 0;
  51.156 -                        WinMapWindowPoints(pVideo->hidden->
  51.157 -                                           hwndClient, HWND_DESKTOP, &ptl, 1);
  51.158 +                        WinMapWindowPoints(pVideo->hidden->hwndClient,
  51.159 +                                           HWND_DESKTOP, &ptl, 1);
  51.160                          pVideo->hidden->iSkipWMMOUSEMOVE++;     /* Don't take next WM_MOUSEMOVE into account!  */
  51.161                          WinSetPointerPos(HWND_DESKTOP,
  51.162                                           ptl.x + swpClient.cx / 2,
  51.163 @@ -910,8 +905,8 @@
  51.164                                            &swpClient);
  51.165                          ptl.x = 0;
  51.166                          ptl.y = 0;
  51.167 -                        WinMapWindowPoints(pVideo->hidden->
  51.168 -                                           hwndClient, HWND_DESKTOP, &ptl, 1);
  51.169 +                        WinMapWindowPoints(pVideo->hidden->hwndClient,
  51.170 +                                           HWND_DESKTOP, &ptl, 1);
  51.171                          pVideo->hidden->iSkipWMMOUSEMOVE++;     /* Don't take next WM_MOUSEMOVE into account!  */
  51.172                          WinSetPointerPos(HWND_DESKTOP,
  51.173                                           ptl.x + swpClient.cx / 2,
  51.174 @@ -1378,6 +1373,7 @@
  51.175      while (len-- > 0)
  51.176          *dst++ = ~*src++;
  51.177  }
  51.178 +
  51.179  static void
  51.180  memxor(Uint8 * dst, Uint8 * src1, Uint8 * src2, int len)
  51.181  {
  51.182 @@ -1635,6 +1631,7 @@
  51.183  {
  51.184      return (-1);
  51.185  }
  51.186 +
  51.187  static void
  51.188  os2fslib_FreeHWSurface(_THIS, SDL_Surface * surface)
  51.189  {
  51.190 @@ -2505,23 +2502,22 @@
  51.191          pResult = SDL_CreateRGBSurface(SDL_SWSURFACE,
  51.192                                         pModeInfoFound->uiXResolution,
  51.193                                         pModeInfoFound->uiYResolution,
  51.194 -                                       pModeInfoFound->uiBPP,
  51.195 -                                       ((unsigned int) pModeInfoFound->
  51.196 -                                        PixelFormat.
  51.197 -                                        ucRedMask) << pModeInfoFound->
  51.198 -                                       PixelFormat.ucRedPosition,
  51.199 -                                       ((unsigned int) pModeInfoFound->
  51.200 -                                        PixelFormat.
  51.201 -                                        ucGreenMask) << pModeInfoFound->
  51.202 -                                       PixelFormat.ucGreenPosition,
  51.203 -                                       ((unsigned int) pModeInfoFound->
  51.204 -                                        PixelFormat.
  51.205 -                                        ucBlueMask) << pModeInfoFound->
  51.206 -                                       PixelFormat.ucBluePosition,
  51.207 -                                       ((unsigned int) pModeInfoFound->
  51.208 -                                        PixelFormat.
  51.209 -                                        ucAlphaMask) << pModeInfoFound->
  51.210 -                                       PixelFormat.ucAlphaPosition);
  51.211 +                                       pModeInfoFound->uiBPP, ((unsigned int)
  51.212 +                                                               pModeInfoFound->PixelFormat.ucRedMask)
  51.213 +                                       << pModeInfoFound->PixelFormat.
  51.214 +                                       ucRedPosition, ((unsigned int)
  51.215 +                                                       pModeInfoFound->
  51.216 +                                                       PixelFormat.ucGreenMask)
  51.217 +                                       << pModeInfoFound->PixelFormat.
  51.218 +                                       ucGreenPosition, ((unsigned int)
  51.219 +                                                         pModeInfoFound->
  51.220 +                                                         PixelFormat.ucBlueMask)
  51.221 +                                       << pModeInfoFound->PixelFormat.
  51.222 +                                       ucBluePosition, ((unsigned int)
  51.223 +                                                        pModeInfoFound->
  51.224 +                                                        PixelFormat.ucAlphaMask)
  51.225 +                                       << pModeInfoFound->PixelFormat.
  51.226 +                                       ucAlphaPosition);
  51.227  
  51.228          if (pResult == NULL) {
  51.229              DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer);
  51.230 @@ -2535,23 +2531,27 @@
  51.231  
  51.232          // Adjust pixel format mask!
  51.233          pResult->format->Rmask =
  51.234 -            ((unsigned int) pModeInfoFound->PixelFormat.
  51.235 -             ucRedMask) << pModeInfoFound->PixelFormat.ucRedPosition;
  51.236 +            ((unsigned int) pModeInfoFound->
  51.237 +             PixelFormat.ucRedMask) << pModeInfoFound->PixelFormat.
  51.238 +            ucRedPosition;
  51.239          pResult->format->Rshift = pModeInfoFound->PixelFormat.ucRedPosition;
  51.240          pResult->format->Rloss = pModeInfoFound->PixelFormat.ucRedAdjust;
  51.241          pResult->format->Gmask =
  51.242 -            ((unsigned int) pModeInfoFound->PixelFormat.
  51.243 -             ucGreenMask) << pModeInfoFound->PixelFormat.ucGreenPosition;
  51.244 +            ((unsigned int) pModeInfoFound->
  51.245 +             PixelFormat.ucGreenMask) << pModeInfoFound->PixelFormat.
  51.246 +            ucGreenPosition;
  51.247          pResult->format->Gshift = pModeInfoFound->PixelFormat.ucGreenPosition;
  51.248          pResult->format->Gloss = pModeInfoFound->PixelFormat.ucGreenAdjust;
  51.249          pResult->format->Bmask =
  51.250 -            ((unsigned int) pModeInfoFound->PixelFormat.
  51.251 -             ucBlueMask) << pModeInfoFound->PixelFormat.ucBluePosition;
  51.252 +            ((unsigned int) pModeInfoFound->
  51.253 +             PixelFormat.ucBlueMask) << pModeInfoFound->PixelFormat.
  51.254 +            ucBluePosition;
  51.255          pResult->format->Bshift = pModeInfoFound->PixelFormat.ucBluePosition;
  51.256          pResult->format->Bloss = pModeInfoFound->PixelFormat.ucBlueAdjust;
  51.257          pResult->format->Amask =
  51.258 -            ((unsigned int) pModeInfoFound->PixelFormat.
  51.259 -             ucAlphaMask) << pModeInfoFound->PixelFormat.ucAlphaPosition;
  51.260 +            ((unsigned int) pModeInfoFound->
  51.261 +             PixelFormat.ucAlphaMask) << pModeInfoFound->PixelFormat.
  51.262 +            ucAlphaPosition;
  51.263          pResult->format->Ashift = pModeInfoFound->PixelFormat.ucAlphaPosition;
  51.264          pResult->format->Aloss = pModeInfoFound->PixelFormat.ucAlphaAdjust;
  51.265  
  51.266 @@ -2738,10 +2738,8 @@
  51.267                          for (i = 0; _this->hidden->pListModesResult[i]; i++) {
  51.268                              iNumOfSlots++;
  51.269                              if (iPlace == -1) {
  51.270 -                                if ((_this->hidden->
  51.271 -                                     pListModesResult[i]->w *
  51.272 -                                     _this->hidden->
  51.273 -                                     pListModesResult[i]->h) <
  51.274 +                                if ((_this->hidden->pListModesResult[i]->w *
  51.275 +                                     _this->hidden->pListModesResult[i]->h) <
  51.276                                      (pRect->w * pRect->h)) {
  51.277                                      iPlace = i;
  51.278                                  }
  51.279 @@ -2754,14 +2752,10 @@
  51.280  //            printf("!!! From %d slots, it will be at %d\n", iNumOfSlots, iPlace);
  51.281  #endif
  51.282  
  51.283 -                        pNewList =
  51.284 -                            (SDL_Rect **) SDL_realloc(_this->
  51.285 -                                                      hidden->
  51.286 -                                                      pListModesResult,
  51.287 -                                                      (iNumOfSlots
  51.288 -                                                       +
  51.289 -                                                       1) *
  51.290 -                                                      sizeof(SDL_Rect *));
  51.291 +                        pNewList = (SDL_Rect **)
  51.292 +                            SDL_realloc(_this->hidden->pListModesResult,
  51.293 +                                        (iNumOfSlots +
  51.294 +                                         1) * sizeof(SDL_Rect *));
  51.295                          if (pNewList) {
  51.296                              for (i = iNumOfSlots; i > iPlace; i--)
  51.297                                  pNewList[i] = pNewList[i - 1];
  51.298 @@ -2816,23 +2810,25 @@
  51.299      vformat->BytesPerPixel = (vformat->BitsPerPixel + 7) / 8;
  51.300  
  51.301      vformat->Rmask =
  51.302 -        ((unsigned int) pDesktopMode->PixelFormat.ucRedMask) << pDesktopMode->
  51.303 -        PixelFormat.ucRedPosition;
  51.304 +        ((unsigned int) pDesktopMode->PixelFormat.
  51.305 +         ucRedMask) << pDesktopMode->PixelFormat.ucRedPosition;
  51.306      vformat->Rshift = pDesktopMode->PixelFormat.ucRedPosition;
  51.307      vformat->Rloss = pDesktopMode->PixelFormat.ucRedAdjust;
  51.308      vformat->Gmask =
  51.309 -        ((unsigned int) pDesktopMode->PixelFormat.
  51.310 -         ucGreenMask) << pDesktopMode->PixelFormat.ucGreenPosition;
  51.311 +        ((unsigned int) pDesktopMode->
  51.312 +         PixelFormat.ucGreenMask) << pDesktopMode->PixelFormat.
  51.313 +        ucGreenPosition;
  51.314      vformat->Gshift = pDesktopMode->PixelFormat.ucGreenPosition;
  51.315      vformat->Gloss = pDesktopMode->PixelFormat.ucGreenAdjust;
  51.316      vformat->Bmask =
  51.317 -        ((unsigned int) pDesktopMode->PixelFormat.
  51.318 -         ucBlueMask) << pDesktopMode->PixelFormat.ucBluePosition;
  51.319 +        ((unsigned int) pDesktopMode->
  51.320 +         PixelFormat.ucBlueMask) << pDesktopMode->PixelFormat.ucBluePosition;
  51.321      vformat->Bshift = pDesktopMode->PixelFormat.ucBluePosition;
  51.322      vformat->Bloss = pDesktopMode->PixelFormat.ucBlueAdjust;
  51.323      vformat->Amask =
  51.324 -        ((unsigned int) pDesktopMode->PixelFormat.
  51.325 -         ucAlphaMask) << pDesktopMode->PixelFormat.ucAlphaPosition;
  51.326 +        ((unsigned int) pDesktopMode->
  51.327 +         PixelFormat.ucAlphaMask) << pDesktopMode->PixelFormat.
  51.328 +        ucAlphaPosition;
  51.329      vformat->Ashift = pDesktopMode->PixelFormat.ucAlphaPosition;
  51.330      vformat->Aloss = pDesktopMode->PixelFormat.ucAlphaAdjust;
  51.331  
  51.332 @@ -2937,10 +2933,10 @@
  51.333                 sizeof(_this->hidden->SrcBufferDesc));
  51.334      // Allocate new video buffer!
  51.335      _this->hidden->pchSrcBuffer =
  51.336 -        (char *) SDL_malloc(_this->hidden->pAvailableFSLibVideoModes->
  51.337 -                            uiScanLineSize *
  51.338 -                            _this->hidden->pAvailableFSLibVideoModes->
  51.339 -                            uiYResolution);
  51.340 +        (char *) SDL_malloc(_this->hidden->
  51.341 +                            pAvailableFSLibVideoModes->uiScanLineSize *
  51.342 +                            _this->hidden->
  51.343 +                            pAvailableFSLibVideoModes->uiYResolution);
  51.344      if (!_this->hidden->pchSrcBuffer) {
  51.345  #ifdef DEBUG_BUILD
  51.346          printf
    52.1 --- a/src/video/photon/SDL_ph_gl.c	Thu Aug 21 12:38:21 2008 +0000
    52.2 +++ b/src/video/photon/SDL_ph_gl.c	Wed Aug 27 04:23:38 2008 +0000
    52.3 @@ -315,14 +315,17 @@
    52.4          && (this->gl_config.accum_blue_size != 0)
    52.5          && (this->gl_config.accum_green_size != 0)) {
    52.6          qnxgl_attribs_slide = qnxgl_attrib_set_accum(qnxgl_attribs_slide,
    52.7 -                                                     this->gl_config.
    52.8 -                                                     accum_red_size +
    52.9 -                                                     this->gl_config.
   52.10 -                                                     accum_blue_size +
   52.11 -                                                     this->gl_config.
   52.12 -                                                     accum_green_size +
   52.13 -                                                     this->gl_config.
   52.14 -                                                     accum_alpha_size);
   52.15 +                                                     this->
   52.16 +                                                     gl_config.accum_red_size
   52.17 +                                                     +
   52.18 +                                                     this->
   52.19 +                                                     gl_config.accum_blue_size
   52.20 +                                                     +
   52.21 +                                                     this->
   52.22 +                                                     gl_config.accum_green_size
   52.23 +                                                     +
   52.24 +                                                     this->
   52.25 +                                                     gl_config.accum_alpha_size);
   52.26      }
   52.27  
   52.28      /* Stereo mode */
    53.1 --- a/src/video/photon/SDL_ph_image.c	Thu Aug 21 12:38:21 2008 +0000
    53.2 +++ b/src/video/photon/SDL_ph_image.c	Wed Aug 27 04:23:38 2008 +0000
    53.3 @@ -244,9 +244,8 @@
    53.4      }
    53.5  
    53.6      if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
    53.7 -        OCImage.FrameData1 =
    53.8 -            (unsigned char *) PdGetOffscreenContextPtr(OCImage.
    53.9 -                                                       offscreen_backcontext);
   53.10 +        OCImage.FrameData1 = (unsigned char *)
   53.11 +            PdGetOffscreenContextPtr(OCImage.offscreen_backcontext);
   53.12          if (OCImage.FrameData1 == NULL) {
   53.13              SDL_SetError
   53.14                  ("ph_SetupFullScreenImage(back): PdGetOffscreenContextPtr() function failed !\n");
    54.1 --- a/src/video/photon/SDL_phyuv.c	Thu Aug 21 12:38:21 2008 +0000
    54.2 +++ b/src/video/photon/SDL_phyuv.c	Wed Aug 27 04:23:38 2008 +0000
    54.3 @@ -149,8 +149,8 @@
    54.4                                      &overlay->hwdata->caps);
    54.5          if (rtncode == 0) {
    54.6              if (overlay->hwdata->caps.format == format) {
    54.7 -                if ((overlay->hwdata->caps.
    54.8 -                     flags & Pg_SCALER_CAP_DST_CHROMA_KEY) ==
    54.9 +                if ((overlay->hwdata->
   54.10 +                     caps.flags & Pg_SCALER_CAP_DST_CHROMA_KEY) ==
   54.11                      Pg_SCALER_CAP_DST_CHROMA_KEY) {
   54.12                      overlay->hwdata->ischromakey = 1;
   54.13                  }
    55.1 --- a/src/video/ps2gs/SDL_gsvideo.c	Thu Aug 21 12:38:21 2008 +0000
    55.2 +++ b/src/video/ps2gs/SDL_gsvideo.c	Wed Aug 27 04:23:38 2008 +0000
    55.3 @@ -232,6 +232,7 @@
    55.4          0x0e,                   /* A+D */
    55.5          0,                      /* 2 */
    55.6  PS2_GS_TEX0_1, (1 << 5) + (1 << 6), PS2_GS_TEX1_1, 0, PS2_GS_TEXFLUSH};
    55.7 +
    55.8  static unsigned long long scale_tags[] __attribute__ ((aligned(16))) = {
    55.9      5 | (1LL << 60),            /* GIFtag */
   55.10          0x0e,                   /* A+D */
   55.11 @@ -573,11 +574,13 @@
   55.12  {
   55.13      return (-1);
   55.14  }
   55.15 +
   55.16  static void
   55.17  GS_FreeHWSurface(_THIS, SDL_Surface * surface)
   55.18  {
   55.19      return;
   55.20  }
   55.21 +
   55.22  static int
   55.23  GS_LockHWSurface(_THIS, SDL_Surface * surface)
   55.24  {
   55.25 @@ -606,6 +609,7 @@
   55.26      }
   55.27      return (0);
   55.28  }
   55.29 +
   55.30  static void
   55.31  GS_UnlockHWSurface(_THIS, SDL_Surface * surface)
   55.32  {
    56.1 --- a/src/video/riscos/SDL_riscosvideo.c	Thu Aug 21 12:38:21 2008 +0000
    56.2 +++ b/src/video/riscos/SDL_riscosvideo.c	Wed Aug 27 04:23:38 2008 +0000
    56.3 @@ -286,6 +286,7 @@
    56.4  {
    56.5      return (-1);
    56.6  }
    56.7 +
    56.8  static void
    56.9  RISCOS_FreeHWSurface(_THIS, SDL_Surface * surface)
   56.10  {
    57.1 --- a/src/video/svga/SDL_svgavideo.c	Thu Aug 21 12:38:21 2008 +0000
    57.2 +++ b/src/video/svga/SDL_svgavideo.c	Wed Aug 27 04:23:38 2008 +0000
    57.3 @@ -467,6 +467,7 @@
    57.4  {
    57.5      return (-1);
    57.6  }
    57.7 +
    57.8  static void
    57.9  SVGA_FreeHWSurface(_THIS, SDL_Surface * surface)
   57.10  {
   57.11 @@ -480,6 +481,7 @@
   57.12      /* The waiting is done in SVGA_FlipHWSurface() */
   57.13      return (0);
   57.14  }
   57.15 +
   57.16  static void
   57.17  SVGA_UnlockHWSurface(_THIS, SDL_Surface * surface)
   57.18  {
    58.1 --- a/src/video/vgl/SDL_vglvideo.c	Thu Aug 21 12:38:21 2008 +0000
    58.2 +++ b/src/video/vgl/SDL_vglvideo.c	Wed Aug 27 04:23:38 2008 +0000
    58.3 @@ -409,6 +409,7 @@
    58.4  {
    58.5      return -1;
    58.6  }
    58.7 +
    58.8  static void
    58.9  VGL_FreeHWSurface(_THIS, SDL_Surface * surface)
   58.10  {
   58.11 @@ -424,6 +425,7 @@
   58.12      }
   58.13      return 0;
   58.14  }
   58.15 +
   58.16  static void
   58.17  VGL_UnlockHWSurface(_THIS, SDL_Surface * surface)
   58.18  {
    59.1 --- a/src/video/win32/SDL_d3drender.c	Thu Aug 21 12:38:21 2008 +0000
    59.2 +++ b/src/video/win32/SDL_d3drender.c	Wed Aug 27 04:23:38 2008 +0000
    59.3 @@ -596,8 +596,8 @@
    59.4      result =
    59.5          IDirect3DDevice9_UpdateTexture(renderdata->device,
    59.6                                         (IDirect3DBaseTexture9 *) temp,
    59.7 -                                       (IDirect3DBaseTexture9 *) data->
    59.8 -                                       texture);
    59.9 +                                       (IDirect3DBaseTexture9 *)
   59.10 +                                       data->texture);
   59.11      IDirect3DTexture9_Release(temp);
   59.12      if (FAILED(result)) {
   59.13          D3D_SetError("UpdateTexture()", result);
   59.14 @@ -805,9 +805,8 @@
   59.15      }
   59.16  
   59.17      result =
   59.18 -        IDirect3DDevice9_SetTexture(data->device, 0,
   59.19 -                                    (IDirect3DBaseTexture9 *) texturedata->
   59.20 -                                    texture);
   59.21 +        IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *)
   59.22 +                                    texturedata->texture);
   59.23      if (FAILED(result)) {
   59.24          D3D_SetError("SetTexture()", result);
   59.25          return -1;
    60.1 --- a/src/video/win32/SDL_gdirender.c	Thu Aug 21 12:38:21 2008 +0000
    60.2 +++ b/src/video/win32/SDL_gdirender.c	Wed Aug 27 04:23:38 2008 +0000
    60.3 @@ -620,9 +620,8 @@
    60.4          SelectPalette(data->memory_hdc, texturedata->hpal, TRUE);
    60.5          RealizePalette(data->memory_hdc);
    60.6      }
    60.7 -    if (texture->
    60.8 -        blendMode & (SDL_TEXTUREBLENDMODE_MASK | SDL_TEXTUREBLENDMODE_BLEND))
    60.9 -    {
   60.10 +    if (texture->blendMode &
   60.11 +        (SDL_TEXTUREBLENDMODE_MASK | SDL_TEXTUREBLENDMODE_BLEND)) {
   60.12          BLENDFUNCTION blendFunc = {
   60.13              AC_SRC_OVER,
   60.14              0,
    61.1 --- a/src/video/win32/SDL_win32keyboard.c	Thu Aug 21 12:38:21 2008 +0000
    61.2 +++ b/src/video/win32/SDL_win32keyboard.c	Wed Aug 27 04:23:38 2008 +0000
    61.3 @@ -41,6 +41,7 @@
    61.4      30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24,
    61.5      25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44
    61.6  };
    61.7 +
    61.8  BYTE keypad_scancodes[10] = {
    61.9      82, 79, 80, 81, 75, 76, 77, 71, 72, 73
   61.10  };
    62.1 --- a/src/video/win32/SDL_win32opengl.c	Thu Aug 21 12:38:21 2008 +0000
    62.2 +++ b/src/video/win32/SDL_win32opengl.c	Wed Aug 27 04:23:38 2008 +0000
    62.3 @@ -500,8 +500,7 @@
    62.4      if (_this->gl_config.accelerated >= 0) {
    62.5          *iAttr++ = WGL_ACCELERATION_ARB;
    62.6          *iAttr++ =
    62.7 -            (_this->gl_config.
    62.8 -             accelerated ? WGL_GENERIC_ACCELERATION_ARB :
    62.9 +            (_this->gl_config.accelerated ? WGL_GENERIC_ACCELERATION_ARB :
   62.10               WGL_NO_ACCELERATION_ARB);
   62.11      }
   62.12  
    63.1 --- a/src/video/wscons/SDL_wsconsvideo.c	Thu Aug 21 12:38:21 2008 +0000
    63.2 +++ b/src/video/wscons/SDL_wsconsvideo.c	Wed Aug 27 04:23:38 2008 +0000
    63.3 @@ -399,6 +399,7 @@
    63.4  {
    63.5      return -1;
    63.6  }
    63.7 +
    63.8  static void
    63.9  WSCONS_FreeHWSurface(_THIS, SDL_Surface * surface)
   63.10  {
    64.1 --- a/src/video/x11/SDL_x11opengl.c	Thu Aug 21 12:38:21 2008 +0000
    64.2 +++ b/src/video/x11/SDL_x11opengl.c	Wed Aug 27 04:23:38 2008 +0000
    64.3 @@ -420,8 +420,8 @@
    64.4      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    64.5      Display *display = data->videodata->display;
    64.6      int screen =
    64.7 -        ((SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->driverdata)->
    64.8 -        screen;
    64.9 +        ((SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->
   64.10 +         driverdata)->screen;
   64.11      XWindowAttributes xattr;
   64.12      XVisualInfo v, *vinfo;
   64.13      int n;
    65.1 --- a/src/video/xbios/SDL_xbiosmodes.c	Thu Aug 21 12:38:21 2008 +0000
    65.2 +++ b/src/video/xbios/SDL_xbiosmodes.c	Wed Aug 27 04:23:38 2008 +0000
    65.3 @@ -277,8 +277,8 @@
    65.4                      SDL_XBIOS_AddMode(_this, falcon_rgb_modes[i].width,
    65.5                                        falcon_rgb_modes[i].height,
    65.6                                        falcon_rgb_modes[i].bpp,
    65.7 -                                      falcon_rgb_modes[i].
    65.8 -                                      modecode & modecodemask, SDL_FALSE);
    65.9 +                                      falcon_rgb_modes[i].modecode &
   65.10 +                                      modecodemask, SDL_FALSE);
   65.11                  }
   65.12                  break;
   65.13              case MONITOR_VGA:
   65.14 @@ -288,8 +288,8 @@
   65.15                      SDL_XBIOS_AddMode(_this, falcon_vga_modes[i].width,
   65.16                                        falcon_vga_modes[i].height,
   65.17                                        falcon_vga_modes[i].bpp,
   65.18 -                                      falcon_vga_modes[i].
   65.19 -                                      modecode & modecodemask, SDL_FALSE);
   65.20 +                                      falcon_vga_modes[i].modecode &
   65.21 +                                      modecodemask, SDL_FALSE);
   65.22                  }
   65.23                  break;
   65.24              }
    66.1 --- a/test/nds-test-progs/general/source/main.c	Thu Aug 21 12:38:21 2008 +0000
    66.2 +++ b/test/nds-test-progs/general/source/main.c	Wed Aug 27 04:23:38 2008 +0000
    66.3 @@ -4,82 +4,93 @@
    66.4  #include <nds.h>
    66.5  #include <fat.h>
    66.6  #else
    66.7 -#define swiWaitForVBlank() 
    66.8 -#define consoleDemoInit() 
    66.9 -#define fatInitDefault() 
   66.10 +#define swiWaitForVBlank()
   66.11 +#define consoleDemoInit()
   66.12 +#define fatInitDefault()
   66.13  #define RGB15(r,g,b) SDL_MapRGB(screen->format,((r)<<3),((g)<<3),((b)<<3))
   66.14  #endif
   66.15 +    void
   66.16 +splash(SDL_Surface * screen, int s)
   66.17 +{
   66.18 +    SDL_Surface *logo;
   66.19 +    SDL_Rect area = { 0, 0, 256, 192 };
   66.20  
   66.21 -void splash(SDL_Surface *screen, int s) {
   66.22 -	SDL_Surface *logo;
   66.23 -	SDL_Rect area = {0,0,256,192};
   66.24 +    logo = SDL_LoadBMP("sdl.bmp");
   66.25 +    if (!logo) {
   66.26 +        printf("Couldn't splash.\n");
   66.27 +        return;
   66.28 +    }
   66.29 +    /*logo->flags &= ~SDL_PREALLOC; */
   66.30 +    SDL_BlitSurface(logo, NULL, screen, &area);
   66.31 +    SDL_Flip(screen);
   66.32 +    while (s-- > 0) {
   66.33 +        int i = 60;
   66.34 +        while (--i)
   66.35 +            swiWaitForVBlank();
   66.36 +    }
   66.37 +}
   66.38  
   66.39 -	logo = SDL_LoadBMP("sdl.bmp");
   66.40 -	if(!logo) {
   66.41 -		printf("Couldn't splash.\n");
   66.42 -		return;
   66.43 -	}
   66.44 -	/*logo->flags &= ~SDL_PREALLOC;*/
   66.45 -	SDL_BlitSurface(logo, NULL, screen, &area);
   66.46 -	SDL_Flip(screen);
   66.47 -	while(s-- > 0) {
   66.48 -		int i = 60;
   66.49 -		while(--i) swiWaitForVBlank();
   66.50 -	}
   66.51 -}
   66.52 +
   66.53 int
   66.54 +main(void)
   66.55 +{
   66.56 +    SDL_Surface *screen;
   66.57 +    SDL_Joystick *stick;
   66.58 +    SDL_Event event;
   66.59 +    SDL_Rect rect = { 0, 0, 256, 192 };
   66.60 +    int i;
   66.61 +
   66.62 +    consoleDemoInit();
   66.63 +    puts("Hello world!  Initializing FAT...");
   66.64 +    fatInitDefault();
   66.65 +    
   66.66 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) {
   66.67 +        puts("# error initializing SDL");
   66.68 +        puts(SDL_GetError());
   66.69 +        return 1;
   66.70 +    }
   66.71 +    puts("* initialized SDL");
   66.72 +    screen = SDL_SetVideoMode(256, 192, 15, SDL_SWSURFACE);
   66.73 +    if (!screen) {
   66.74 +        puts("# error setting video mode");
   66.75 +        puts(SDL_GetError());
   66.76 +        return 2;
   66.77 +    }
   66.78 +    screen->flags &= ~SDL_PREALLOC;
   66.79 +    puts("* set video mode");
   66.80 +    stick = SDL_JoystickOpen(0);
   66.81 +    if (stick == NULL) {
   66.82 +        puts("# error opening joystick");
   66.83 +        puts(SDL_GetError());
   66.84 +//              return 3;
   66.85 +    }
   66.86 +    puts("* opened joystick");
   66.87 +
   66.88 +    /*splash(screen, 3); */
   66.89 +
   66.90 +    SDL_FillRect(screen, &rect, RGB15(0, 0, 31) | 0x8000);
   66.91 +    SDL_Flip(screen);
   66.92 +
   66.93 +    while (1)
   66.94 +        while (SDL_PollEvent(&event))
   66.95 +            switch (event.type) {
   66.96 +            case SDL_JOYBUTTONDOWN:
   66.97 +                SDL_FillRect(screen, &rect, (u16) rand() | 0x8000);
   66.98 +                SDL_Flip(screen);
   66.99 +                if (rect.w > 8) {
  66.100 +                    rect.x += 4;
  66.101 +                    rect.y += 3;
  66.102 +                    rect.w -= 8;
  66.103 +                    rect.h -= 6;
  66.104 +                }
  66.105 +                printf("button %d pressed at %d ticks\n",
  66.106 +                       event.jbutton.which, SDL_GetTicks());
  66.107 +                break;
  66.108 +            case SDL_QUIT:
  66.109 +                SDL_Quit();
  66.110 +                return 0;
  66.111 +            default:
  66.112 +                break;
  66.113 +            }
  66.114 +    
  66.115 return 0;
  66.116 +
  66.117 }
  66.118 +
  66.119  
  66.120 -int main(void) {
  66.121 -	SDL_Surface *screen;
  66.122 -	SDL_Joystick *stick;
  66.123 -	SDL_Event event;
  66.124 -	SDL_Rect rect = {0,0,256,192};
  66.125 -	int i;
  66.126 -
  66.127 -	consoleDemoInit(); puts("Hello world!  Initializing FAT...");
  66.128 -	fatInitDefault();
  66.129 -	if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0) {
  66.130 -		puts("# error initializing SDL");
  66.131 -		puts(SDL_GetError());
  66.132 -		return 1;
  66.133 -	}
  66.134 -	puts("* initialized SDL");
  66.135 -	screen = SDL_SetVideoMode(256, 192, 15, SDL_SWSURFACE);
  66.136 -	if(!screen) {
  66.137 -		puts("# error setting video mode");
  66.138 -		puts(SDL_GetError());
  66.139 -		return 2;
  66.140 -	}
  66.141 -	screen->flags &= ~SDL_PREALLOC;
  66.142 -	puts("* set video mode");
  66.143 -	stick = SDL_JoystickOpen(0);
  66.144 -	if(stick == NULL) {
  66.145 -		puts("# error opening joystick");
  66.146 -		puts(SDL_GetError());
  66.147 -//		return 3;
  66.148 -	}
  66.149 -	puts("* opened joystick");
  66.150 -
  66.151 -	/*splash(screen, 3);*/
  66.152 -
  66.153 -	SDL_FillRect(screen, &rect, RGB15(0,0,31)|0x8000);
  66.154 -	SDL_Flip(screen);
  66.155 -
  66.156 -	while(1)
  66.157 -	while(SDL_PollEvent(&event))
  66.158 -	switch(event.type) {
  66.159 -		case SDL_JOYBUTTONDOWN:
  66.160 -			SDL_FillRect(screen, &rect, (u16)rand()|0x8000);
  66.161 -			SDL_Flip(screen);
  66.162 -			if(rect.w > 8) {
  66.163 -				rect.x += 4; rect.y += 3;
  66.164 -				rect.w -= 8; rect.h -= 6;
  66.165 -			}
  66.166 -			printf("button %d pressed at %d ticks\n",
  66.167 -			       event.jbutton.which, SDL_GetTicks());
  66.168 -		break;
  66.169 -		case SDL_QUIT: SDL_Quit(); return 0;
  66.170 -		default: break;
  66.171 -	}
  66.172 -
  66.173 -	return 0;
  66.174 -}
    67.1 --- a/test/nds-test-progs/sprite/source/testsprite.c	Thu Aug 21 12:38:21 2008 +0000
    67.2 +++ b/test/nds-test-progs/sprite/source/testsprite.c	Wed Aug 27 04:23:38 2008 +0000
    67.3 @@ -163,7 +163,8 @@
    67.4      SDL_Event event;
    67.5      Uint32 then, now, frames;
    67.6  
    67.7 -    consoleDemoInit(); puts("Hello world!  Initializing FAT...");
    67.8 +    consoleDemoInit();
    67.9 +    puts("Hello world!  Initializing FAT...");
   67.10      fatInitDefault();
   67.11      /* Initialize SDL */
   67.12      if (SDL_Init(SDL_INIT_VIDEO) < 0) {
   67.13 @@ -173,7 +174,7 @@
   67.14      puts("* initialized SDL");
   67.15  
   67.16      numsprites = NUM_SPRITES;
   67.17 -    videoflags = SDL_SWSURFACE /*| SDL_ANYFORMAT*/;
   67.18 +    videoflags = SDL_SWSURFACE /*| SDL_ANYFORMAT */ ;
   67.19      width = 256;
   67.20      height = 192;
   67.21      video_bpp = 15;
    68.1 --- a/test/nds-test-progs/sprite2/source/testsprite2.c	Thu Aug 21 12:38:21 2008 +0000
    68.2 +++ b/test/nds-test-progs/sprite2/source/testsprite2.c	Wed Aug 27 04:23:38 2008 +0000
    68.3 @@ -81,9 +81,11 @@
    68.4      return (0);
    68.5  }
    68.6  
    68.7 -int LoadSprite2(const u8* ptr, int size) {
    68.8 +int
    68.9 +LoadSprite2(const u8 * ptr, int size)
   68.10 +{
   68.11      int i;
   68.12 -    SDL_Rect r = {0,0,32,32};
   68.13 +    SDL_Rect r = { 0, 0, 32, 32 };
   68.14      for (i = 0; i < state->num_windows; ++i) {
   68.15          SDL_SelectRenderer(state->windows[i]);
   68.16          sprites[i] = SDL_CreateTexture(SDL_PIXELFORMAT_ABGR1555,
   68.17 @@ -92,7 +94,7 @@
   68.18              fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
   68.19              return -1;
   68.20          }
   68.21 -        SDL_UpdateTexture(sprites[i], &r, ptr, r.w*2);
   68.22 +        SDL_UpdateTexture(sprites[i], &r, ptr, r.w * 2);
   68.23          SDL_SetTextureBlendMode(sprites[i], blendMode);
   68.24          SDL_SetTextureScaleMode(sprites[i], scaleMode);
   68.25      }
   68.26 @@ -170,7 +172,8 @@
   68.27      SDL_Event event;
   68.28      Uint32 then, now, frames;
   68.29  
   68.30 -    consoleDemoInit(); puts("Hello world!  Initializing FAT...");
   68.31 +    consoleDemoInit();
   68.32 +    puts("Hello world!  Initializing FAT...");
   68.33      fatInitDefault();
   68.34  
   68.35      /* Initialize parameters */