src/video/nds/SDL_ndsrender.c
branchgsoc2008_nds
changeset 2680 4135aa9c5645
parent 2679 bc3e3e889f6d
child 2681 c15b6c758be5
     1.1 --- a/src/video/nds/SDL_ndsrender.c	Sun Jul 13 04:28:54 2008 +0000
     1.2 +++ b/src/video/nds/SDL_ndsrender.c	Sat Jul 19 17:37:19 2008 +0000
     1.3 @@ -159,6 +159,7 @@
     1.4  /*  Uint32 Rmask = 0x7C00, Gmask = 0x03E0, Bmask = 0x001F, Amask = 0x8000;
     1.5      Uint32 Rmask = 0x001F, Gmask = 0x03E0, Bmask = 0x7C00, Amask = 0x8000;
     1.6  */
     1.7 +printf("+NDS_CreateRenderer\n");
     1.8  
     1.9      /* hard coded this to BGR555 for now */
    1.10      if (!SDL_PixelFormatEnumToMasks(SDL_PIXELFORMAT_BGR555, &bpp,
    1.11 @@ -220,6 +221,7 @@
    1.12      data->bg_taken[2] = data->bg_taken[3] = 0;
    1.13      data->sub = 0;
    1.14  
    1.15 +printf("-NDS_CreateRenderer\n");
    1.16      return renderer;
    1.17  }
    1.18  
    1.19 @@ -228,6 +230,7 @@
    1.20  {
    1.21      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
    1.22      /* stub. TODO: figure out what needs to be done, if anything. */
    1.23 +printf("!NDS_ActivateRenderer\n");
    1.24      return 0;
    1.25  }
    1.26  
    1.27 @@ -236,6 +239,7 @@
    1.28  {
    1.29      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
    1.30      /* stub. TODO: figure out what needs to be done */
    1.31 +printf("!NDS_DisplayModeChanged\n");
    1.32      return 0;
    1.33  }
    1.34  
    1.35 @@ -244,6 +248,7 @@
    1.36  {
    1.37      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
    1.38      NDS_TextureData *txdat = NULL;
    1.39 +printf("+NDS_CreateTexture\n");
    1.40      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    1.41          SDL_SetError("Unsupported texture format");
    1.42          return -1;
    1.43 @@ -301,6 +306,7 @@
    1.44          }
    1.45      }
    1.46  
    1.47 +printf("-NDS_CreateTexture\n");
    1.48      if (!texture->driverdata) {
    1.49          return -1;
    1.50      }
    1.51 @@ -311,6 +317,7 @@
    1.52  NDS_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
    1.53                        void **pixels, int *pitch)
    1.54  {
    1.55 +printf("+NDS_QueryTexturePixels\n");
    1.56      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    1.57          SDL_SetError("Unsupported texture format");
    1.58          return -1;
    1.59 @@ -319,6 +326,7 @@
    1.60  
    1.61          *pixels = txdat->vram;
    1.62          *pitch = txdat->dim.pitch;
    1.63 +printf("-NDS_QueryTexturePixels\n");
    1.64          return 0;
    1.65      }
    1.66  }
    1.67 @@ -327,12 +335,14 @@
    1.68  NDS_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
    1.69                       const SDL_Color * colors, int firstcolor, int ncolors)
    1.70  {
    1.71 +printf("+NDS_SetTexturePalette\n");
    1.72      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    1.73          SDL_SetError("YUV textures don't have a palette");
    1.74          return -1;
    1.75      } else {
    1.76          NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
    1.77          /* TODO: mess with 8-bit modes and/or 16-color palette modes */
    1.78 +printf("-NDS_SetTexturePalette\n");
    1.79          return 0;
    1.80      }
    1.81  }
    1.82 @@ -341,11 +351,13 @@
    1.83  NDS_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
    1.84                       SDL_Color * colors, int firstcolor, int ncolors)
    1.85  {
    1.86 +printf("+NDS_GetTexturePalette\n");
    1.87      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    1.88          SDL_SetError("YUV textures don't have a palette");
    1.89          return -1;
    1.90      } else {
    1.91          NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
    1.92 +printf("-NDS_GetTexturePalette\n");
    1.93          /* TODO: mess with 8-bit modes and/or 16-color palette modes */
    1.94          return 0;
    1.95      }
    1.96 @@ -354,6 +366,7 @@
    1.97  static int
    1.98  NDS_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture)
    1.99  {
   1.100 +printf("!NDS_SetTextureColorMod\n");
   1.101      /* stub. TODO: figure out what needs to be done, if anything */
   1.102      return 0;
   1.103  }
   1.104 @@ -361,6 +374,7 @@
   1.105  static int
   1.106  NDS_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture)
   1.107  {
   1.108 +printf("!NDS_SetTextureAlphaMod\n");
   1.109      /* stub. TODO: figure out what needs to be done, if anything */
   1.110      return 0;
   1.111  }
   1.112 @@ -368,6 +382,7 @@
   1.113  static int
   1.114  NDS_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
   1.115  {
   1.116 +printf("!NDS_SetTextureBlendMode\n");
   1.117      /* stub. TODO: figure out what needs to be done, if anything */
   1.118      return 0;
   1.119  }
   1.120 @@ -375,6 +390,7 @@
   1.121  static int
   1.122  NDS_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
   1.123  {
   1.124 +printf("!NDS_SetTextureScaleMode\n");
   1.125      /* stub. TODO: figure out what needs to be done.
   1.126         (NDS hardware scaling is nearest neighbor.) */
   1.127      return 0;
   1.128 @@ -384,6 +400,7 @@
   1.129  NDS_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   1.130                   const SDL_Rect * rect, const void *pixels, int pitch)
   1.131  {
   1.132 +printf("+NDS_UpdateTexture\n");
   1.133      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
   1.134          SDL_SetError("Unsupported texture format");
   1.135          return -1;
   1.136 @@ -403,6 +420,7 @@
   1.137              src += pitch;
   1.138              dst += txdat->dim.pitch;
   1.139          }
   1.140 +printf("-NDS_UpdateTexture\n");
   1.141          return 0;
   1.142      }
   1.143  }
   1.144 @@ -412,6 +430,7 @@
   1.145                 const SDL_Rect * rect, int markDirty, void **pixels,
   1.146                 int *pitch)
   1.147  {
   1.148 +printf("+NDS_LockTexture\n");
   1.149      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
   1.150          SDL_SetError("Unsupported texture format");
   1.151          return -1;
   1.152 @@ -421,6 +440,7 @@
   1.153          *pixels = (void *) ((u8 *)txdat->vram + rect->y * txdat->dim.pitch
   1.154                              + rect->x * (txdat->dim.bpp/8));
   1.155          *pitch = txdat->dim.pitch;
   1.156 +printf("-NDS_LockTexture\n");
   1.157          return 0;
   1.158      }
   1.159  }
   1.160 @@ -431,12 +451,14 @@
   1.161      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
   1.162          SDL_SetError("Unsupported texture format");
   1.163      }
   1.164 +printf("!NDS_UnlockTexture\n");
   1.165  }
   1.166  
   1.167  static void
   1.168  NDS_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   1.169                  int numrects, const SDL_Rect * rects)
   1.170  { /* stub */
   1.171 +printf("!NDS_DirtyTexture\n");
   1.172  }
   1.173  
   1.174  static int
   1.175 @@ -448,6 +470,7 @@
   1.176      u16 color;
   1.177      int i, j;
   1.178  
   1.179 +printf("+NDS_RenderFill\n");
   1.180      /* TODO: make a single-color sprite and stretch it.
   1.181      color = RGB15(r>>3,g>>3,b>>3);
   1.182      for (i = real_rect.x; i < real_rect.x+real_rect.w; ++i) {
   1.183 @@ -456,6 +479,7 @@
   1.184                  0x8000 | color;
   1.185          }
   1.186      }*/
   1.187 +printf("-NDS_RenderFill\n");
   1.188      return 0;
   1.189  }
   1.190  
   1.191 @@ -467,6 +491,7 @@
   1.192      SDL_Window *window = SDL_GetWindowFromID(renderer->window);
   1.193      SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
   1.194  
   1.195 +printf("+NDS_RenderCopy\n");
   1.196  #if 0
   1.197      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
   1.198          SDL_Surface *target = data->screens[data->current_screen];
   1.199 @@ -485,6 +510,7 @@
   1.200          return SDL_LowerBlit(surface, &real_srcrect, target, &real_dstrect);
   1.201      }
   1.202  #endif
   1.203 +printf("-NDS_RenderCopy\n");
   1.204      return 0;
   1.205  }
   1.206  
   1.207 @@ -495,21 +521,25 @@
   1.208      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
   1.209      /* Send the data to the display TODO */
   1.210  
   1.211 +printf("+NDS_RenderPresent\n");
   1.212      /* Update the flipping chain, if any */
   1.213      if (renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) {
   1.214          swiWaitForVBlank();
   1.215      }
   1.216 +printf("-NDS_RenderPresent\n");
   1.217  }
   1.218  
   1.219  static void
   1.220  NDS_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
   1.221  {
   1.222 +printf("+NDS_DestroyTexture\n");
   1.223      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
   1.224          SDL_SetError("Unsupported texture format");
   1.225      } else {
   1.226          /* free anything else allocated for texture */
   1.227          SDL_free(texture->driverdata);
   1.228      }
   1.229 +printf("-NDS_DestroyTexture\n");
   1.230  }
   1.231  
   1.232  static void
   1.233 @@ -520,6 +550,7 @@
   1.234      SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);*/
   1.235      int i;
   1.236  
   1.237 +printf("+NDS_DestroyRenderer\n");
   1.238      if (data) {
   1.239          /* TODO: free anything relevant. */
   1.240          /*for (i = 0; i < SDL_arraysize(data->texture); ++i) {
   1.241 @@ -539,6 +570,7 @@
   1.242          SDL_free(data);
   1.243      }
   1.244      SDL_free(renderer);
   1.245 +printf("-NDS_DestroyRenderer\n");
   1.246  }
   1.247  
   1.248  /* vi: set ts=4 sw=4 expandtab: */