src/video/fbcon/SDL_fb3dfx.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/video/fbcon/SDL_fb3dfx.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/video/fbcon/SDL_fb3dfx.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -29,29 +29,29 @@
     1.4  
     1.5  /* Wait for vertical retrace */
     1.6  static void
     1.7 -WaitVBL (_THIS)
     1.8 +WaitVBL(_THIS)
     1.9  {
    1.10      /* find start of retrace */
    1.11 -    tdfx_waitidle ();
    1.12 -    while ((tdfx_in32 (TDFX_STATUS) & STATUS_RETRACE) == STATUS_RETRACE);
    1.13 +    tdfx_waitidle();
    1.14 +    while ((tdfx_in32(TDFX_STATUS) & STATUS_RETRACE) == STATUS_RETRACE);
    1.15      /* wait until we're past the start */
    1.16 -    while ((tdfx_in32 (TDFX_STATUS) & STATUS_RETRACE) == 0);
    1.17 +    while ((tdfx_in32(TDFX_STATUS) & STATUS_RETRACE) == 0);
    1.18  }
    1.19  static void
    1.20 -WaitIdle (_THIS)
    1.21 +WaitIdle(_THIS)
    1.22  {
    1.23 -    tdfx_waitidle ();
    1.24 +    tdfx_waitidle();
    1.25  }
    1.26  
    1.27  /* Sets video mem colorkey and accelerated blit function */
    1.28  static int
    1.29 -SetHWColorKey (_THIS, SDL_Surface * surface, Uint32 key)
    1.30 +SetHWColorKey(_THIS, SDL_Surface * surface, Uint32 key)
    1.31  {
    1.32      return (0);
    1.33  }
    1.34  
    1.35  static int
    1.36 -FillHWRect (_THIS, SDL_Surface * dst, SDL_Rect * rect, Uint32 color)
    1.37 +FillHWRect(_THIS, SDL_Surface * dst, SDL_Rect * rect, Uint32 color)
    1.38  {
    1.39      int bpp;
    1.40      char *dst_base;
    1.41 @@ -63,7 +63,7 @@
    1.42          return -2;              /* no hardware access */
    1.43      }
    1.44      if (dst == this->screen) {
    1.45 -        SDL_mutexP (hw_lock);
    1.46 +        SDL_mutexP(hw_lock);
    1.47      }
    1.48  
    1.49      /* Set the destination pixel format */
    1.50 @@ -76,25 +76,25 @@
    1.51      dstY = rect->y;
    1.52  
    1.53      /* Execute the fill command */
    1.54 -    tdfx_wait (6);
    1.55 -    tdfx_out32 (DSTBASE, (Uint32) dst_base);
    1.56 -    tdfx_out32 (DSTFORMAT, format);
    1.57 -    tdfx_out32 (COLORFORE, color);
    1.58 -    tdfx_out32 (COMMAND_2D, COMMAND_2D_FILLRECT);
    1.59 -    tdfx_out32 (DSTSIZE, rect->w | (rect->h << 16));
    1.60 -    tdfx_out32 (LAUNCH_2D, dstX | (dstY << 16));
    1.61 +    tdfx_wait(6);
    1.62 +    tdfx_out32(DSTBASE, (Uint32) dst_base);
    1.63 +    tdfx_out32(DSTFORMAT, format);
    1.64 +    tdfx_out32(COLORFORE, color);
    1.65 +    tdfx_out32(COMMAND_2D, COMMAND_2D_FILLRECT);
    1.66 +    tdfx_out32(DSTSIZE, rect->w | (rect->h << 16));
    1.67 +    tdfx_out32(LAUNCH_2D, dstX | (dstY << 16));
    1.68  
    1.69 -    FB_AddBusySurface (dst);
    1.70 +    FB_AddBusySurface(dst);
    1.71  
    1.72      if (dst == this->screen) {
    1.73 -        SDL_mutexV (hw_lock);
    1.74 +        SDL_mutexV(hw_lock);
    1.75      }
    1.76      return (0);
    1.77  }
    1.78  
    1.79  static int
    1.80 -HWAccelBlit (SDL_Surface * src, SDL_Rect * srcrect,
    1.81 -             SDL_Surface * dst, SDL_Rect * dstrect)
    1.82 +HWAccelBlit(SDL_Surface * src, SDL_Rect * srcrect,
    1.83 +            SDL_Surface * dst, SDL_Rect * dstrect)
    1.84  {
    1.85      SDL_VideoDevice *this = current_video;
    1.86      int bpp;
    1.87 @@ -112,7 +112,7 @@
    1.88          return -2;              /* no hardware access */
    1.89      }
    1.90      if (dst == this->screen) {
    1.91 -        SDL_mutexP (hw_lock);
    1.92 +        SDL_mutexP(hw_lock);
    1.93      }
    1.94  
    1.95      /* Set the source and destination pixel format */
    1.96 @@ -131,48 +131,48 @@
    1.97      /* Assemble the blit operation */
    1.98      blitop = COMMAND_2D_BITBLT | (0xCC << 24);
    1.99      if (srcX <= dstX) {
   1.100 -        blitop |= BIT (14);
   1.101 +        blitop |= BIT(14);
   1.102          srcX += (dstrect->w - 1);
   1.103          dstX += (dstrect->w - 1);
   1.104      }
   1.105      if (srcY <= dstY) {
   1.106 -        blitop |= BIT (15);
   1.107 +        blitop |= BIT(15);
   1.108          srcY += (dstrect->h - 1);
   1.109          dstY += (dstrect->h - 1);
   1.110      }
   1.111  
   1.112      /* Perform the blit! */
   1.113      if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) {
   1.114 -        tdfx_wait (3);
   1.115 -        tdfx_out32 (SRCCOLORKEYMIN, src->format->colorkey);
   1.116 -        tdfx_out32 (SRCCOLORKEYMAX, src->format->colorkey);
   1.117 -        tdfx_out32 (ROP_2D, 0xAA00);
   1.118 +        tdfx_wait(3);
   1.119 +        tdfx_out32(SRCCOLORKEYMIN, src->format->colorkey);
   1.120 +        tdfx_out32(SRCCOLORKEYMAX, src->format->colorkey);
   1.121 +        tdfx_out32(ROP_2D, 0xAA00);
   1.122          use_colorkey = 1;
   1.123      } else {
   1.124          use_colorkey = 0;
   1.125      }
   1.126 -    tdfx_wait (9);
   1.127 -    tdfx_out32 (SRCBASE, (Uint32) src_base);
   1.128 -    tdfx_out32 (SRCFORMAT, src_format);
   1.129 -    tdfx_out32 (DSTBASE, (Uint32) dst_base);
   1.130 -    tdfx_out32 (DSTFORMAT, src_format);
   1.131 -    tdfx_out32 (COMMAND_2D, blitop);
   1.132 -    tdfx_out32 (COMMANDEXTRA_2D, use_colorkey);
   1.133 -    tdfx_out32 (DSTSIZE, dstrect->w | (dstrect->h << 16));
   1.134 -    tdfx_out32 (DSTXY, dstX | (dstY << 16));
   1.135 -    tdfx_out32 (LAUNCH_2D, srcX | (srcY << 16));
   1.136 +    tdfx_wait(9);
   1.137 +    tdfx_out32(SRCBASE, (Uint32) src_base);
   1.138 +    tdfx_out32(SRCFORMAT, src_format);
   1.139 +    tdfx_out32(DSTBASE, (Uint32) dst_base);
   1.140 +    tdfx_out32(DSTFORMAT, src_format);
   1.141 +    tdfx_out32(COMMAND_2D, blitop);
   1.142 +    tdfx_out32(COMMANDEXTRA_2D, use_colorkey);
   1.143 +    tdfx_out32(DSTSIZE, dstrect->w | (dstrect->h << 16));
   1.144 +    tdfx_out32(DSTXY, dstX | (dstY << 16));
   1.145 +    tdfx_out32(LAUNCH_2D, srcX | (srcY << 16));
   1.146  
   1.147 -    FB_AddBusySurface (src);
   1.148 -    FB_AddBusySurface (dst);
   1.149 +    FB_AddBusySurface(src);
   1.150 +    FB_AddBusySurface(dst);
   1.151  
   1.152      if (dst == this->screen) {
   1.153 -        SDL_mutexV (hw_lock);
   1.154 +        SDL_mutexV(hw_lock);
   1.155      }
   1.156      return (0);
   1.157  }
   1.158  
   1.159  static int
   1.160 -CheckHWBlit (_THIS, SDL_Surface * src, SDL_Surface * dst)
   1.161 +CheckHWBlit(_THIS, SDL_Surface * src, SDL_Surface * dst)
   1.162  {
   1.163      int accelerated;
   1.164  
   1.165 @@ -200,7 +200,7 @@
   1.166  }
   1.167  
   1.168  void
   1.169 -FB_3DfxAccel (_THIS, __u32 card)
   1.170 +FB_3DfxAccel(_THIS, __u32 card)
   1.171  {
   1.172      /* We have hardware accelerated surface functions */
   1.173      this->CheckHWBlit = CheckHWBlit;
   1.174 @@ -208,8 +208,8 @@
   1.175      wait_idle = WaitIdle;
   1.176  
   1.177      /* Reset the 3Dfx controller */
   1.178 -    tdfx_out32 (BRESERROR0, 0);
   1.179 -    tdfx_out32 (BRESERROR1, 0);
   1.180 +    tdfx_out32(BRESERROR0, 0);
   1.181 +    tdfx_out32(BRESERROR1, 0);
   1.182  
   1.183      /* The 3Dfx has an accelerated color fill */
   1.184      this->info.blit_fill = 1;