Updated Nintendo DS support
authorSam Lantinga <slouken@libsdl.org>
Sun, 12 Feb 2012 21:04:01 -0500
changeset 6285f12649068adb
parent 6284 1893d507ba42
child 6286 087aff26a39d
Updated Nintendo DS support

Frank Zago

This patch updates the DS port:
- do not use the now removed compat layer.
- integrate parts of libgl2D since I got permission from the author, and thus
removed an external dependancy,
- a few bugs fixes.

Now, the textures should be completely supported, except reading from them
which doesn't makes sense to have on the DS. Sound is still not supported.

If someone else wants to work on the missing pieces, feel free.
Makefile.ds
README.ds
src/render/nds/SDL_libgl2D.c
src/render/nds/SDL_libgl2D.h
src/render/nds/SDL_ndsrender.c
src/video/nds/SDL_ndsvideo.c
test/nds-test-progs/general/Makefile
test/nds-test-progs/general/source/main.c
test/nds-test-progs/testscale/Makefile
test/nds-test-progs/testsprite2/Makefile
test/nds-test-progs/testspriteminimal/Makefile
     1.1 --- a/Makefile.ds	Sun Feb 12 20:57:32 2012 -0500
     1.2 +++ b/Makefile.ds	Sun Feb 12 21:04:01 2012 -0500
     1.3 @@ -28,7 +28,7 @@
     1.4  		-D__NDS__ -DENABLE_NDS -DNO_SIGNAL_H -DDISABLE_THREADS -DPACKAGE=\"SDL\" \
     1.5  		 -DVERSION=\"2.0\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1  
     1.6  
     1.7 -CFLAGS	:=	-g -Wall -O2\
     1.8 +CFLAGS	:=	-g -Wall -Os\
     1.9  		-march=armv5te -mtune=arm946e-s \
    1.10  		-fomit-frame-pointer -ffast-math \
    1.11  		$(ARCH)
    1.12 @@ -39,7 +39,7 @@
    1.13  ASFLAGS	:=	-g $(ARCH) -march=armv5te -mtune=arm946e-s
    1.14  LDFLAGS	=	-specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
    1.15  
    1.16 -# Set to 0 to use a framer buffer, or 1 to use the hardware
    1.17 +# Set to 0 to use a framer buffer, or 1 to use the GL like hardware
    1.18  # renderer. Alas, both cannot be used at the same time for lack of
    1.19  # display/texture memory.
    1.20  USE_HW_RENDERER := 1
    1.21 @@ -72,7 +72,6 @@
    1.22  CFILES		:=	\
    1.23  			SDL.c \
    1.24  			SDL_assert.c \
    1.25 -			SDL_compat.c \
    1.26  			SDL_error.c \
    1.27  			SDL_fatal.c \
    1.28  			SDL_hints.c \
    1.29 @@ -104,6 +103,7 @@
    1.30  			render/SDL_render.c \
    1.31  			render/SDL_yuv_sw.c \
    1.32  			render/nds/SDL_ndsrender.c \
    1.33 +			render/nds/SDL_libgl2D.c \
    1.34  			render/software/SDL_blendfillrect.c \
    1.35  			render/software/SDL_blendline.c \
    1.36  			render/software/SDL_blendpoint.c \
     2.1 --- a/README.ds	Sun Feb 12 20:57:32 2012 -0500
     2.2 +++ b/README.ds	Sun Feb 12 21:04:01 2012 -0500
     2.3 @@ -6,11 +6,8 @@
     2.4  * The devkitpro SDK available at http://devkitpro.org.
     2.5    Read the information at http://devkitpro.org/wiki/Getting_Started/devkitARM
     2.6    The necessary packages are devkitARM, libnds, libfat and default arm7.
     2.7 -* The hardware renderer is using the libgl2d abstraction library that can be found at:
     2.8 -    http://rel.phatcode.net/junk.php?id=117
     2.9 -  Build it, and install the library and the header where SDL can find them (ie. in
    2.10 -  the libnds/lib and libnds/include directories).
    2.11 -
    2.12 +* Optionally, use a DS emulator, such as desmume (http://desmume.org/)
    2.13 +  to program and debug.
    2.14  
    2.15  -Building SDL-
    2.16  
    2.17 @@ -18,16 +15,24 @@
    2.18    make -f Makefile.ds
    2.19  
    2.20  This will compile and install the library and headers into the
    2.21 -devkitpro's portlibs directory. Additionnaly it will compile several
    2.22 -tests that you can run either on the DS or with desmume. For instance:
    2.23 +devkitpro's portlibs directory (../portlibs/arm/lib/ and
    2.24 +../portlibs/arm/include/). Additionally it will compile several tests
    2.25 +that you can run either on the DS or with desmume. For instance:
    2.26 +  desmume --cflash-path=test/ test/nds-test-progs/testsprite2/testsprite2.nds
    2.27 +  desmume --cflash-path=test/ test/nds-test-progs/testspriteminimal/testspriteminimal.nds
    2.28 +  desmume --cflash-path=test/ test/nds-test-progs/testscale/testscale.nds 
    2.29    desmume test/nds-test-progs/general/general.nds
    2.30  
    2.31  -Notes-
    2.32  * The renderer code is based on the gl like engine. It's not using the sprite engine.
    2.33 +* The hardware renderer is using the parts of the libgl2d abstraction library that can be found at:
    2.34 +    http://rel.phatcode.net/junk.php?id=117
    2.35 +  Used with the author's permission.
    2.36  * The port is very basic and incomplete:
    2.37 -  - SDL currently has to be compiled for either framebuffer mode or render mode.
    2.38 +  - SDL currently has to be compiled for either framebuffer mode or renderer mode.
    2.39       See USE_HW_RENDERER in Makefile.ds.
    2.40    - some optional renderer functions are not implemented.
    2.41 +  - no sound
    2.42  
    2.43  -Limitations-
    2.44  * in hardware renderer mode, don't load too many textures. The internal format is
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/render/nds/SDL_libgl2D.c	Sun Feb 12 21:04:01 2012 -0500
     3.3 @@ -0,0 +1,310 @@
     3.4 +/*
     3.5 + * Note: The Nintendo DS port to SDL uses excerpts from the libGL2D,
     3.6 + * with permission of the original author. The following is mostly his
     3.7 + * code/comments.
     3.8 + *
     3.9 + *
    3.10 + *	Easy GL2D
    3.11 + *
    3.12 + *	Relminator 2010 
    3.13 + *	Richard Eric M. Lope BSN RN
    3.14 + *
    3.15 + *	http://rel.betterwebber.com
    3.16 + *
    3.17 + *	A very small and simple DS rendering lib using the 3d core to render 2D stuff
    3.18 + */
    3.19 +
    3.20 +#include "SDL_libgl2D.h"
    3.21 +
    3.22 +/*
    3.23 + * Our static global variable used for Depth values since we cannot
    3.24 + * disable depth testing in the DS hardware This value is incremented
    3.25 + * for every draw call. */
    3.26 +v16 g_depth;
    3.27 +int gCurrentTexture;
    3.28 +
    3.29 +/*
    3.30 + * !!! PRIVATE !!!  Set orthographic projection at 1:1 correspondence
    3.31 + * to screen coords glOrtho expects f32 values but if we use the
    3.32 + * standard f32 values, we need to rescale either every vert or the
    3.33 + * modelview matrix by the same amount to make it work.  That's gonna
    3.34 + * give us lots of overflows and headaches.  So we "scale down" and
    3.35 + * use an all integer value.
    3.36 + */
    3.37 +void SetOrtho(void)		
    3.38 +{
    3.39 +	glMatrixMode(GL_PROJECTION); // set matrixmode to projection
    3.40 +	glLoadIdentity();			   // reset
    3.41 +	glOrthof32(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1 << 12, 1 << 12);  // downscale projection matrix
    3.42 +}
    3.43 +
    3.44 +/*
    3.45 + * Initializes GL in 2D mode Also initializes GL in 3d mode so that we
    3.46 + * could combine 2D and 3D later Almost a direct copy from the DS
    3.47 + * example files
    3.48 + */
    3.49 +void glScreen2D(void)
    3.50 +{
    3.51 +	// initialize gl
    3.52 +	glInit();
    3.53 +	
    3.54 +	// enable textures
    3.55 +	glEnable(GL_TEXTURE_2D);
    3.56 +	
    3.57 +	// enable antialiasing
    3.58 +	glEnable(GL_ANTIALIAS);
    3.59 +		
    3.60 +	// setup the rear plane
    3.61 +	glClearColor(0, 0, 0, 31); // BG must be opaque for AA to work
    3.62 +	glClearPolyID(63); // BG must have a unique polygon ID for AA to work
    3.63 +	
    3.64 +	glClearDepth(GL_MAX_DEPTH);
    3.65 +
    3.66 +	// this should work the same as the normal gl call
    3.67 +	glViewport(0,0,255,191);
    3.68 +
    3.69 +	// any floating point gl call is being converted to fixed prior to being implemented
    3.70 +	glMatrixMode(GL_PROJECTION);
    3.71 +	glLoadIdentity();
    3.72 +	gluPerspective(70, 256.0 / 192.0, 1, 200);
    3.73 +
    3.74 +	gluLookAt(	0.0, 0.0, 1.0,		//camera possition 
    3.75 +				0.0, 0.0, 0.0,		//look at
    3.76 +				0.0, 1.0, 0.0);		//up
    3.77 +
    3.78 +	glMaterialf(GL_AMBIENT, RGB15(31,31,31));
    3.79 +	glMaterialf(GL_DIFFUSE, RGB15(31,31,31));
    3.80 +	glMaterialf(GL_SPECULAR, BIT(15) | RGB15(31,31,31));
    3.81 +	glMaterialf(GL_EMISSION, RGB15(31,31,31));
    3.82 +
    3.83 +	// ds uses a table for shinyness..this generates a half-ass one
    3.84 +	glMaterialShinyness();
    3.85 +
    3.86 +	// not a real gl function and will likely change
    3.87 +	glPolyFmt(POLY_ALPHA(31) | POLY_CULL_BACK);
    3.88 +}
    3.89 +
    3.90 +/*
    3.91 + * Sets up OpenGL for 2d rendering Call this before drawing any of
    3.92 + * GL2D's drawing or sprite functions.
    3.93 + */
    3.94 +void glBegin2D(void)
    3.95 +{
    3.96 +	// save 3d perpective projection matrix
    3.97 +	glMatrixMode(GL_PROJECTION);   
    3.98 +    glPushMatrix();
    3.99 +	
   3.100 +	// save 3d modelview matrix for safety
   3.101 +	glMatrixMode(GL_MODELVIEW);
   3.102 +    glPushMatrix();
   3.103 +	
   3.104 +	
   3.105 +	// what?!! No glDisable(GL_DEPTH_TEST)?!!!!!!
   3.106 +	glEnable(GL_BLEND);
   3.107 +	glEnable(GL_TEXTURE_2D);
   3.108 +	glDisable(GL_ANTIALIAS);	// disable AA
   3.109 +	glDisable(GL_OUTLINE);	// disable edge-marking
   3.110 +
   3.111 +	glColor(0x7FFF);			// max color
   3.112 +	
   3.113 +	glPolyFmt(POLY_ALPHA(31) | POLY_CULL_NONE);  // no culling
   3.114 +
   3.115 +	SetOrtho();
   3.116 +	
   3.117 +	glMatrixMode(GL_TEXTURE);	// reset texture matrix just in case we did some funky stuff with it
   3.118 +	glLoadIdentity();
   3.119 +	
   3.120 +	glMatrixMode(GL_MODELVIEW); // reset modelview matrix. No need to scale up by << 12
   3.121 +	glLoadIdentity();
   3.122 +
   3.123 +	gCurrentTexture = 0;		// set current texture to 0 
   3.124 +	g_depth = 0; // set depth to 0. We need this var since we cannot disable depth testing
   3.125 +}
   3.126 +
   3.127 +/*
   3.128 + * Issue this after drawing 2d so that we don't mess the matrix stack.
   3.129 + * The complement of glBegin2D.
   3.130 + */
   3.131 +void glEnd2D(void)
   3.132 +{
   3.133 +	// restore 3d matrices and set current matrix to modelview
   3.134 +	glMatrixMode(GL_PROJECTION);    
   3.135 +    glPopMatrix(1);
   3.136 +	glMatrixMode(GL_MODELVIEW);
   3.137 +    glPopMatrix(1);
   3.138 +}
   3.139 +
   3.140 +/*
   3.141 + * Draws a pixel
   3.142 + * Parameters:
   3.143 + *   x,y 	-> First coordinate of the line 
   3.144 + *   color 	-> RGB15/ARGB16 color 
   3.145 + */
   3.146 +void glPutPixel(int x, int y, int color)
   3.147 +{
   3.148 +	glBindTexture(0, 0);
   3.149 +	glColor(color);
   3.150 +	glBegin(GL_TRIANGLES);
   3.151 +		gxVertex3i(x, y, g_depth);
   3.152 +		gxVertex2i(x, y);
   3.153 +		gxVertex2i(x, y);
   3.154 +	glEnd();
   3.155 +	glColor(0x7FFF);
   3.156 +	g_depth++;
   3.157 +	gCurrentTexture = 0;
   3.158 +}
   3.159 +
   3.160 +/*
   3.161 + * Draws a line
   3.162 + * Parameters:
   3.163 + *   x1,y1 	-> First coordinate of the line 
   3.164 + *   x2,y2 	-> Second coordinate of the line 
   3.165 + *   color 	-> RGB15/ARGB16 color
   3.166 + */
   3.167 +void glLine(int x1, int y1, int x2, int y2, int color)
   3.168 +{
   3.169 +	x2++;
   3.170 +	y2++;
   3.171 +	
   3.172 +	glBindTexture(0, 0);
   3.173 +	glColor(color);
   3.174 +	glBegin(GL_TRIANGLES);
   3.175 +		gxVertex3i(x1, y1, g_depth);
   3.176 +		gxVertex2i(x2, y2);
   3.177 +		gxVertex2i(x2, y2);
   3.178 +	glEnd();
   3.179 +	glColor(0x7FFF);
   3.180 +	g_depth++;
   3.181 +	gCurrentTexture = 0;
   3.182 +}
   3.183 +
   3.184 +/*
   3.185 + * Draws a Filled Box
   3.186 + * Parameters:
   3.187 + *   x1,y1 	-> Top-left corner of the box 
   3.188 + *   x2,y2 	-> Bottom-Right corner of the box 
   3.189 + *   color 	-> RGB15/ARGB16 color 
   3.190 +*/
   3.191 +void glBoxFilled(int x1, int y1, int x2, int y2, int color)
   3.192 +{
   3.193 +	x2++;
   3.194 +	y2++;
   3.195 +	
   3.196 +	glBindTexture(0, 0);
   3.197 +	glColor(color);
   3.198 +	glBegin(GL_QUADS);
   3.199 +		gxVertex3i(x1, y1, g_depth); // use 3i for first vertex so that we increment HW depth
   3.200 +		gxVertex2i(x1, y2); // no need for 3 vertices as 2i would share last depth call
   3.201 +		gxVertex2i(x2, y2);
   3.202 +		gxVertex2i(x2, y1);
   3.203 +	glEnd();
   3.204 +	glColor(0x7FFF);
   3.205 +	g_depth++;
   3.206 +	gCurrentTexture = 0;
   3.207 +}
   3.208 +
   3.209 +/*
   3.210 + *
   3.211 + * Create a tile.
   3.212 + * Very rigid and prone to human error.
   3.213 + *
   3.214 + * Parameters:
   3.215 + *   *sprite 		 -> pointer to a glImage
   3.216 + *   texture_width   -> width/height of the texture;
   3.217 + *   texture_height  ->  valid sizes are enumerated in GL_TEXTURE_TYPE_ENUM (see glTexImage2d)
   3.218 + *   sprite_width
   3.219 + *   sprite_height   -> width/height of the picture in the texture.
   3.220 + *   type 		     -> The format of the texture (see glTexImage2d)
   3.221 + *   param 		     -> parameters for the texture (see glTexImage2d)
   3.222 + */
   3.223 +int glLoadTile(glImage              *sprite,
   3.224 +			   int                  texture_width,
   3.225 +			   int                  texture_height,
   3.226 +			   int                  sprite_width,
   3.227 +			   int                  sprite_height,
   3.228 +			   GL_TEXTURE_TYPE_ENUM type,
   3.229 +			   int 	                param,
   3.230 +			   int					pallette_width,
   3.231 +			   const u16			*palette,
   3.232 +			   const uint8          *texture)
   3.233 +{
   3.234 +	int textureID;
   3.235 +
   3.236 +	glGenTextures(1, &textureID);
   3.237 +	glBindTexture(0, textureID);
   3.238 +	glTexImage2D(0, 0, type, texture_width, texture_height, 0, param, texture);
   3.239 +	glColorTableEXT(0, 0, pallette_width, 0, 0, palette);
   3.240 +
   3.241 +	sprite->width 			= sprite_width;
   3.242 +	sprite->height 			= sprite_height;
   3.243 +	sprite->textureID 		= textureID;
   3.244 +	
   3.245 +	return textureID;
   3.246 +}
   3.247 +
   3.248 +/*
   3.249 + * I made this since the scale wrappers are either the vectorized mode
   3.250 + * or does not permit you to scale only the axis you want to
   3.251 + * scale. Needed for sprite scaling.
   3.252 + */
   3.253 +static inline void gxScalef32(s32 x, s32 y, s32 z)
   3.254 +{
   3.255 +	MATRIX_SCALE = x;
   3.256 +	MATRIX_SCALE = y;
   3.257 +	MATRIX_SCALE = z;
   3.258 +}
   3.259 +
   3.260 +/*
   3.261 + * I this made for future naming conflicts.
   3.262 + */
   3.263 +static inline void gxTranslate3f32(int32 x, int32 y, int32 z) 
   3.264 +{
   3.265 +	MATRIX_TRANSLATE = x;
   3.266 +	MATRIX_TRANSLATE = y;
   3.267 +	MATRIX_TRANSLATE = z;
   3.268 +}
   3.269 +
   3.270 +/*
   3.271 + * Draws an axis exclusive scaled sprite
   3.272 + * Parameters:
   3.273 + *   x 			-> x position of the sprite
   3.274 + *   y 			-> y position of the sprite
   3.275 + *   scaleX   	-> 20.12 FP X axis scale value (1 << 12 is normal)
   3.276 + *   scaleY   	-> 20.12 FP Y axis scale value (1 << 12 is normal)
   3.277 + *   flipmode 	-> mode for flipping (see GL_FLIP_MODE enum)
   3.278 + *   *spr 		-> pointer to a glImage
   3.279 + */
   3.280 +void glSpriteScaleXY(int x, int y, s32 scaleX, s32 scaleY, int flipmode, const glImage *spr)
   3.281 +{
   3.282 +	const int x1 = 0;
   3.283 +	const int y1 = 0;
   3.284 +	const int x2 = spr->width;
   3.285 +	const int y2 = spr->height;
   3.286 +	const int u1 = ((flipmode & GL_FLIP_H) ? spr->width-1  : 0);
   3.287 + 	const int u2 = ((flipmode & GL_FLIP_H) ? 0 : spr->width-1);
   3.288 +	const int v1 = ((flipmode & GL_FLIP_V) ? spr->height-1 : 0);
   3.289 +	const int v2 = ((flipmode & GL_FLIP_V) ? 0 : spr->height-1);
   3.290 + 
   3.291 +    if (spr->textureID != gCurrentTexture)
   3.292 +    {
   3.293 +        glBindTexture(GL_TEXTURE_2D, spr->textureID);
   3.294 +        gCurrentTexture = spr->textureID;
   3.295 +    }
   3.296 +
   3.297 +	glPushMatrix();
   3.298 +
   3.299 +		gxTranslate3f32(x, y, 0);
   3.300 +		gxScalef32(scaleX, scaleY, 1 << 12);
   3.301 +
   3.302 +		glBegin(GL_QUADS);
   3.303 +			
   3.304 +			gxTexcoord2i(u1, v1); gxVertex3i(x1, y1, g_depth);	
   3.305 +			gxTexcoord2i(u1, v2); gxVertex2i(x1, y2);
   3.306 +			gxTexcoord2i(u2, v2); gxVertex2i(x2, y2);
   3.307 +			gxTexcoord2i(u2, v1); gxVertex2i(x2, y1);
   3.308 +			
   3.309 +		glEnd();
   3.310 +	
   3.311 +	glPopMatrix(1);
   3.312 +	g_depth++;
   3.313 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/render/nds/SDL_libgl2D.h	Sun Feb 12 21:04:01 2012 -0500
     4.3 @@ -0,0 +1,150 @@
     4.4 +/*
     4.5 + * Note: The Nintendo DS port to SDL uses excerpts from the libGL2D,
     4.6 + * with permission of the original author. The following is mostly his
     4.7 + * code/comments.
     4.8 + *
     4.9 + *
    4.10 + *	Easy GL2D
    4.11 + *
    4.12 + *	Relminator 2010 
    4.13 + *	Richard Eric M. Lope BSN RN
    4.14 + *
    4.15 + *	http://rel.betterwebber.com
    4.16 + *
    4.17 + *	A very small and simple DS rendering lib using the 3d core to render 2D stuff
    4.18 + */
    4.19 +
    4.20 +#include <nds/arm9/videoGL.h>
    4.21 +
    4.22 +/* LibGL extension(s) */
    4.23 +static inline void gxTexcoord2i(t16 u, t16 v)
    4.24 +{
    4.25 +	GFX_TEX_COORD = (v << 20) | ((u << 4) & 0xFFFF);
    4.26 +}
    4.27 +
    4.28 +static inline void gxVertex3i(v16 x, v16 y, v16 z)
    4.29 +{
    4.30 +	GFX_VERTEX16 = (y << 16) | (x & 0xFFFF);
    4.31 +	GFX_VERTEX16 = ((uint32)(uint16)z);
    4.32 +}
    4.33 +
    4.34 +static inline void gxVertex2i(v16 x, v16 y)
    4.35 +{
    4.36 +	GFX_VERTEX_XY = (y << 16) | (x & 0xFFFF);	
    4.37 +}
    4.38 +
    4.39 +/*
    4.40 + * Enums selecting flipping mode.
    4.41 + *
    4.42 + *	These enums are bits for flipping the sprites.
    4.43 + *	You can "|" (or) GL_FLIP_V and GL_FLIP_H to flip 
    4.44 + *	both ways.
    4.45 + */
    4.46 +typedef enum
    4.47 +{
    4.48 +	GL_FLIP_NONE 	= (1 << 0), /* No flipping */
    4.49 +	GL_FLIP_V 		= (1 << 1), /* Sprite is rendered vertically flipped */
    4.50 +	GL_FLIP_H 		= (1 << 2), /* Sprite is rendered horizontally flipped */
    4.51 +} GL_FLIP_MODE;
    4.52 +
    4.53 +/* Struct for out GL-Based Images. */
    4.54 +typedef struct 
    4.55 +{
    4.56 +	int		width;		/* Width of the Sprite */      			
    4.57 +	int 	height;		/* Height of the Sprite */	
    4.58 +	int		textureID;  /* Texture handle (used in glDeleteTextures())
    4.59 +						   The texture handle in VRAM (returned by glGenTextures())
    4.60 +						   ie. This references the actual texture stored in VRAM. */
    4.61 +} glImage;
    4.62 +
    4.63 +extern v16 g_depth;
    4.64 +extern int gCurrentTexture;
    4.65 +
    4.66 +/*
    4.67 + * Draws an Axis Exclusive Scaled Sprite
    4.68 + * Parameters:
    4.69 + *   x X position of the sprite.
    4.70 + *   y Y position of the sprite.
    4.71 + *   scaleX 20.12 fixed-point X-Axis scale value (1 << 12 is normal).
    4.72 + *   scaleY 20.12 fixed-point Y-Axis scale value (1 << 12 is normal).
    4.73 + *   flipmode mode for flipping (see GL_FLIP_MODE enum).
    4.74 + *   *spr pointer to a glImage. 
    4.75 +*/
    4.76 +void glSpriteScaleXY(int x, int y, s32 scaleX, s32 scaleY, int flipmode, const glImage *spr);
    4.77 +
    4.78 +/* Initializes our Tileset (like glInitSpriteset()) but without the use of Texture Packer auto-generated files.
    4.79 + * Can only be used when tiles in a tilset are of the same dimensions.
    4.80 + * Parameters:
    4.81 + *   *sprite Pointer to an array of glImage.
    4.82 + *   tile_wid Width of each tile in the texture.
    4.83 + *   tile_hei Height of each tile in the texture.
    4.84 + *   bmp_wid Width of of the texture or tileset.
    4.85 + *   bmp_hei height of of the texture or tileset.
    4.86 + *   type The format of the texture (see glTexImage2d()).
    4.87 + *   sizeX The horizontal size of the texture; valid sizes are enumerated in GL_TEXTURE_TYPE_ENUM (see glTexImage2d()).
    4.88 + *   sizeY The vertical size of the texture; valid sizes are enumerated in GL_TEXTURE_TYPE_ENUM (see glTexImage2d()).
    4.89 + *   param parameters for the texture (see glTexImage2d()). 
    4.90 + *   pallette_width Length of the palette. Valid values are <b>4, 16, 32, 256</b> (if <b>0</b>, then palette is removed from currently bound texture). 
    4.91 + *   *palette Pointer to the palette data to load (if NULL, then palette is removed from currently bound texture).
    4.92 + *   *texture Pointer to the texture data to load.
    4.93 +*/
    4.94 +int glLoadTile(glImage              *sprite,
    4.95 +			   int                  texture_width,
    4.96 +			   int                  texture_height,
    4.97 +			   int                  sprite_width,
    4.98 +			   int                  sprite_height,
    4.99 +			   GL_TEXTURE_TYPE_ENUM type,
   4.100 +			   int 	                param,
   4.101 +			   int					pallette_width,
   4.102 +			   const u16			*palette,
   4.103 +			   const uint8          *texture);
   4.104 +
   4.105 +/* Initializes GL in 2D mode */
   4.106 +void glScreen2D(void);
   4.107 +
   4.108 +/* 
   4.109 + * Sets up OpenGL for 2d rendering. 
   4.110 + *
   4.111 + * Call this before drawing any of GL2D's drawing or sprite functions.
   4.112 + */
   4.113 +void glBegin2D(void);
   4.114 +
   4.115 +/*
   4.116 + * Issue this after drawing 2d so that we don't mess the matrix stack.
   4.117 + *
   4.118 + * The complement of glBegin2D().
   4.119 + */
   4.120 +void glEnd2D(void);
   4.121 +
   4.122 +/*
   4.123 + * Draws a Pixel
   4.124 + *   x X position of the pixel.
   4.125 + *   y Y position of the pixel.
   4.126 + *   color RGB15/ARGB16 color.
   4.127 + */
   4.128 +void glPutPixel(int x, int y, int color);
   4.129 +
   4.130 +/*
   4.131 + * Draws a Line
   4.132 + *   x1,y1 Top-Left coordinate of the line.
   4.133 + *   x2,y2 Bottom-Right coordinate of the line.
   4.134 + *   color RGB15/ARGB16 color.
   4.135 + */
   4.136 +void glLine(int x1, int y1, int x2, int y2, int color);
   4.137 +
   4.138 +/* 
   4.139 + * Draws a Box
   4.140 + *   x1,y1 Top-Left coordinate of the box.
   4.141 + *   x2,y2 Bottom-Right coordinate of the box.
   4.142 + *   color RGB15/ARGB16 color.
   4.143 +*/
   4.144 +void glBox(int x1, int y1, int x2, int y2, int color);
   4.145 +
   4.146 +/*
   4.147 + * Draws a Filled Box
   4.148 + *   x1,y1 Top-Left coordinate of the box.
   4.149 + *   x2,y2 Bottom-Right coordinate of the box.
   4.150 + *   color RGB15/ARGB16 color.
   4.151 + */
   4.152 +void glBoxFilled(int x1, int y1, int x2, int y2, int color);
   4.153 +
     5.1 --- a/src/render/nds/SDL_ndsrender.c	Sun Feb 12 20:57:32 2012 -0500
     5.2 +++ b/src/render/nds/SDL_ndsrender.c	Sun Feb 12 21:04:01 2012 -0500
     5.3 @@ -26,7 +26,7 @@
     5.4  #include <stdlib.h>
     5.5  #include <nds.h>
     5.6  
     5.7 -#include <gl2d.h>
     5.8 +#include "SDL_libgl2D.h"
     5.9  
    5.10  #include "SDL_video.h"
    5.11  #include "../../video/SDL_sysvideo.h"
    5.12 @@ -34,6 +34,36 @@
    5.13  #include "../SDL_sysrender.h"
    5.14  #include "SDL_log.h"
    5.15  
    5.16 +/* Draws a partial sprite. Based on glSprite. */
    5.17 +static void glSpritePartial(const SDL_Rect * srcrect, int x, int y, int flipmode, const glImage *spr)
    5.18 +{
    5.19 +	int x1 = x;
    5.20 +	int y1 = y;
    5.21 +	int x2 = x + srcrect->w;
    5.22 +	int y2 = y + srcrect->h;
    5.23 +
    5.24 +	int	u1 = srcrect->x + ((flipmode & GL_FLIP_H) ? spr->width-1  : 0);
    5.25 + 	int	u2 = srcrect->x + ((flipmode & GL_FLIP_H) ? 0 : srcrect->h);
    5.26 +	int v1 = srcrect->y + ((flipmode & GL_FLIP_V) ? spr->height-1 : 0);
    5.27 + 	int v2 = srcrect->y + ((flipmode & GL_FLIP_V) ? 0 : srcrect->h);
    5.28 +
    5.29 +    if (spr->textureID != gCurrentTexture) {
    5.30 +        glBindTexture(GL_TEXTURE_2D, spr->textureID);
    5.31 +        gCurrentTexture = spr->textureID;
    5.32 +    }
    5.33 +
    5.34 +	glBegin(GL_QUADS);
    5.35 +		
    5.36 +		gxTexcoord2i(u1, v1); gxVertex3i(x1, y1, g_depth);	
    5.37 +		gxTexcoord2i(u1, v2); gxVertex2i(x1, y2);
    5.38 +		gxTexcoord2i(u2, v2); gxVertex2i(x2, y2);
    5.39 +		gxTexcoord2i(u2, v1); gxVertex2i(x2, y1);
    5.40 +		
    5.41 +	glEnd();
    5.42 +	
    5.43 +	g_depth++;
    5.44 +}
    5.45 +
    5.46  /* SDL NDS renderer implementation */
    5.47  
    5.48  extern SDL_RenderDriver NDS_RenderDriver;
    5.49 @@ -49,7 +79,6 @@
    5.50  	glImage image[1];
    5.51  } NDS_TextureData;
    5.52  
    5.53 -
    5.54  static int NDS_UpdateViewport(SDL_Renderer *renderer)
    5.55  {
    5.56  	/* Nothing to do. */
    5.57 @@ -70,9 +99,9 @@
    5.58  		dest_y = dstrect->y-SCREEN_HEIGHT;
    5.59  	}
    5.60  
    5.61 -	if (texture->w == dstrect->w && texture->h == dstrect->h) {
    5.62 +	if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
    5.63  		/* No scaling */
    5.64 -		glSprite(dstrect->x, dest_y, GL_FLIP_NONE, txdat->image);
    5.65 +		glSpritePartial(srcrect, dstrect->x, dest_y, GL_FLIP_NONE, txdat->image);
    5.66  	} else {
    5.67  		/* Convert the scaling proportion into a 20.12 value. */
    5.68  		s32 scale_w = divf32(dstrect->w << 12, texture->w << 12);
    5.69 @@ -153,15 +182,42 @@
    5.70  							 const SDL_Rect * rect, const void *pixels, int pitch)
    5.71  {
    5.72      NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
    5.73 +	char *new_pixels = NULL;
    5.74 +	const int gl_w = get_gltexture_size(rect->w);
    5.75 +	const int gl_h = get_gltexture_size(rect->h);
    5.76 +	const int w = 1 << (3+gl_w);	/* Texture sizes must be a power of 2. */
    5.77 +	const int h = 1 << (3+gl_h);	/* Texture sizes must be a power of 2. */
    5.78  
    5.79 -	glLoadTileSet(txdat->image,
    5.80 -				  rect->w, rect->h,
    5.81 +	if (w != rect->w || h != rect->h) {
    5.82 +		/* Allocate a temporary surface and copy pixels into it while
    5.83 +		 * enlarging the pitch. */
    5.84 +		const char *src;
    5.85 +		char *dst;
    5.86 +		int new_pitch = 2 * w;
    5.87 +		int i;
    5.88 +
    5.89 +		new_pixels = malloc(2 * w * h);
    5.90 +		if (!new_pixels)
    5.91 +			return SDL_ENOMEM;
    5.92 +
    5.93 +		src = pixels;
    5.94 +		dst = new_pixels;
    5.95 +		for (i=0; i<rect->h; i++) {
    5.96 +			memcpy(dst, src, pitch);
    5.97 +			src += pitch;
    5.98 +			dst += new_pitch;
    5.99 +		}
   5.100 +	}
   5.101 +
   5.102 +	glLoadTile(txdat->image,
   5.103 +				  gl_w, gl_h,
   5.104  				  rect->w, rect->h,
   5.105  				  texture->format == SDL_PIXELFORMAT_ABGR1555 ? GL_RGBA : GL_RGB,
   5.106 -				  get_gltexture_size(rect->w),
   5.107 -				  get_gltexture_size(rect->h),
   5.108  				  TEXGEN_OFF, 0, NULL,
   5.109 -				  pixels);
   5.110 +				  new_pixels? new_pixels : pixels);
   5.111 +
   5.112 +	if (new_pixels)
   5.113 +		free(new_pixels);
   5.114  
   5.115      return 0;
   5.116  }
   5.117 @@ -193,7 +249,6 @@
   5.118  static void NDS_RenderPresent(SDL_Renderer * renderer)
   5.119  {
   5.120      NDS_RenderData *data = (NDS_RenderData *) renderer->driverdata;
   5.121 -	static int frame =0;
   5.122  
   5.123  	glEnd2D();
   5.124  		
   5.125 @@ -324,18 +379,20 @@
   5.126      renderer->info = NDS_RenderDriver.info;
   5.127      renderer->info.flags = SDL_RENDERER_ACCELERATED;
   5.128  
   5.129 -	renderer->UpdateViewport = NDS_UpdateViewport;
   5.130 -    renderer->CreateTexture = NDS_CreateTexture;
   5.131 -	renderer->DestroyTexture = NDS_DestroyTexture;
   5.132 -	renderer->RenderCopy = NDS_RenderCopy;	
   5.133 +	renderer->CreateTexture = NDS_CreateTexture;
   5.134  	renderer->UpdateTexture = NDS_UpdateTexture;
   5.135  	renderer->LockTexture = NDS_LockTexture;
   5.136  	renderer->UnlockTexture = NDS_UnlockTexture;
   5.137 +	renderer->UpdateViewport = NDS_UpdateViewport;
   5.138  	renderer->RenderClear = NDS_RenderClear;
   5.139 -	renderer->RenderPresent = NDS_RenderPresent;
   5.140  	renderer->RenderDrawPoints = NDS_RenderDrawPoints;
   5.141  	renderer->RenderDrawLines = NDS_RenderDrawLines;
   5.142  	renderer->RenderFillRects = NDS_RenderFillRects;
   5.143 +	renderer->RenderCopy = NDS_RenderCopy;
   5.144 +	/* renderer->RenderReadPixels = NDS_RenderReadPixels; - todo ? */
   5.145 +	renderer->RenderPresent = NDS_RenderPresent;
   5.146 +	renderer->DestroyTexture = NDS_DestroyTexture;
   5.147 +	/* renderer->DestroyRenderer = NDS_DestroyRenderer; - todo ? */
   5.148  
   5.149  	renderer->driverdata = data;
   5.150  
     6.1 --- a/src/video/nds/SDL_ndsvideo.c	Sun Feb 12 20:57:32 2012 -0500
     6.2 +++ b/src/video/nds/SDL_ndsvideo.c	Sun Feb 12 21:04:01 2012 -0500
     6.3 @@ -28,12 +28,12 @@
     6.4  #include <stdlib.h>
     6.5  #include <nds.h>
     6.6  #include <fat.h>
     6.7 -#include <gl2d.h>
     6.8  
     6.9  #include "SDL_video.h"
    6.10  #include "SDL_ndsvideo.h"
    6.11  #include "SDL_ndsevents_c.h"
    6.12  #include "../../render/SDL_sysrender.h"
    6.13 +#include "../../render/nds/SDL_libgl2D.h"
    6.14  #include "SDL_log.h"
    6.15  
    6.16  #define NDSVID_DRIVER_NAME "nds"
     7.1 --- a/test/nds-test-progs/general/Makefile	Sun Feb 12 20:57:32 2012 -0500
     7.2 +++ b/test/nds-test-progs/general/Makefile	Sun Feb 12 21:04:01 2012 -0500
     7.3 @@ -28,7 +28,7 @@
     7.4  # note: arm9tdmi isn't the correct CPU arch, but anything newer and LD
     7.5  # *insists* it has a FPU or VFP, and it won't take no for an answer!
     7.6  CFLAGS	:=	-save-temps -g -Wall -O0\
     7.7 - 			-mcpu=arm9tdmi -mtune=arm9tdmi \
     7.8 +			-mcpu=arm9tdmi -mtune=arm9tdmi \
     7.9  			$(ARCH)
    7.10  
    7.11  CFLAGS	+=	$(INCLUDE) -DARM9 -D__NDS__
    7.12 @@ -41,23 +41,23 @@
    7.13  # any extra libraries we wish to link with the project
    7.14  #---------------------------------------------------------------------------------
    7.15  LIBS	:= -lSDL -lfat -lnds9
    7.16 - 
    7.17 - 
    7.18 +
    7.19 +
    7.20  #---------------------------------------------------------------------------------
    7.21  # list of directories containing libraries, this must be the top level containing
    7.22  # include and lib
    7.23  #---------------------------------------------------------------------------------
    7.24 -LIBDIRS	:=	$(LIBNDS)
    7.25 - 
    7.26 +LIBDIRS	:=	$(LIBNDS) $(PORTLIBS)
    7.27 +
    7.28  #---------------------------------------------------------------------------------
    7.29  # no real need to edit anything past this point unless you need to add additional
    7.30  # rules for different file extensions
    7.31  #---------------------------------------------------------------------------------
    7.32  ifneq ($(BUILD),$(notdir $(CURDIR)))
    7.33  #---------------------------------------------------------------------------------
    7.34 - 
    7.35 +
    7.36  export OUTPUT	:=	$(CURDIR)/$(TARGET)
    7.37 - 
    7.38 +
    7.39  export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
    7.40  					$(foreach dir,$(DATA),$(CURDIR)/$(dir))
    7.41  
    7.42 @@ -67,7 +67,7 @@
    7.43  CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
    7.44  SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
    7.45  BINFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
    7.46 - 
    7.47 +
    7.48  #---------------------------------------------------------------------------------
    7.49  # use CXX for linking C++ projects, CC for standard C
    7.50  #---------------------------------------------------------------------------------
    7.51 @@ -84,32 +84,31 @@
    7.52  
    7.53  export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
    7.54  					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
    7.55 - 
    7.56 +
    7.57  export INCLUDE	:=	$(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
    7.58  					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
    7.59 -					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
    7.60  					-I$(CURDIR)/$(BUILD)
    7.61 - 
    7.62 +
    7.63  export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib)
    7.64 - 
    7.65 +
    7.66  .PHONY: $(BUILD) clean
    7.67 - 
    7.68 +
    7.69  #---------------------------------------------------------------------------------
    7.70  $(BUILD):
    7.71  	@[ -d $@ ] || mkdir -p $@
    7.72  	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
    7.73 - 
    7.74 +
    7.75  #---------------------------------------------------------------------------------
    7.76  clean:
    7.77  	@echo clean ...
    7.78  	@rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(TARGET).arm9 $(TARGET).ds.gba 
    7.79 - 
    7.80 - 
    7.81 +
    7.82 +
    7.83  #---------------------------------------------------------------------------------
    7.84  else
    7.85 - 
    7.86 +
    7.87  DEPENDS	:=	$(OFILES:.o=.d)
    7.88 - 
    7.89 +
    7.90  #---------------------------------------------------------------------------------
    7.91  # main targets
    7.92  #---------------------------------------------------------------------------------
    7.93 @@ -117,16 +116,16 @@
    7.94  $(OUTPUT).nds	: 	$(OUTPUT).arm9
    7.95  $(OUTPUT).arm9	:	$(OUTPUT).elf
    7.96  $(OUTPUT).elf	:	$(OFILES)
    7.97 - 
    7.98 +
    7.99  #---------------------------------------------------------------------------------
   7.100  %.pcx.o	:	%.pcx
   7.101  #---------------------------------------------------------------------------------
   7.102  	@echo $(notdir $<)
   7.103  	@$(bin2o)
   7.104 - 
   7.105 - 
   7.106 +
   7.107 +
   7.108  -include $(DEPENDS)
   7.109 - 
   7.110 +
   7.111  #---------------------------------------------------------------------------------------
   7.112  endif
   7.113  #---------------------------------------------------------------------------------------
     8.1 --- a/test/nds-test-progs/general/source/main.c	Sun Feb 12 20:57:32 2012 -0500
     8.2 +++ b/test/nds-test-progs/general/source/main.c	Sun Feb 12 21:04:01 2012 -0500
     8.3 @@ -1,39 +1,34 @@
     8.4 -
     8.5 +/*
     8.6 + * Really basic sample for the NDS.
     8.7 + *
     8.8 + * Fills a rectangle increasingly smaller of random color every time a
     8.9 + * button (a, b, x, y) is pressed.
    8.10 + *
    8.11 + * The behaviour whether SDL is compiled with HW support or not (see
    8.12 + * USE_HW_RENDERER in Makefile.ds).
    8.13 + *
    8.14 + * In framebuffer mode, the old rectangles stay because the screen has
    8.15 + * not been cleared.
    8.16 + *
    8.17 + * In accelerated mode, old the last rectangle is visible.
    8.18 + *
    8.19 + * No text is displayed.
    8.20 + */
    8.21 +
    8.22  #include <SDL/SDL.h>
    8.23  #if defined(NDS) || defined(__NDS__) || defined (__NDS)
    8.24  #include <nds.h>
    8.25  #include <fat.h>
    8.26  #else
    8.27 -#define swiWaitForVBlank()
    8.28  #define consoleDemoInit()
    8.29  #define fatInitDefault()
    8.30  #define RGB15(r,g,b) SDL_MapRGB(screen->format,((r)<<3),((g)<<3),((b)<<3))
    8.31  #endif
    8.32 -    void
    8.33 -splash(SDL_Surface * screen, int s)
    8.34 +
    8.35 +int main(void)
    8.36  {
    8.37 -    SDL_Surface *logo;
    8.38 -    SDL_Rect area = { 0, 0, 256, 192 };
    8.39 -
    8.40 -    logo = SDL_LoadBMP("sdl.bmp");
    8.41 -    if (!logo) {
    8.42 -        printf("Couldn't splash.\n");
    8.43 -        return;
    8.44 -    }
    8.45 -    /*logo->flags &= ~SDL_PREALLOC; */
    8.46 -    SDL_BlitSurface(logo, NULL, screen, &area);
    8.47 -    SDL_Flip(screen);
    8.48 -    while (s-- > 0) {
    8.49 -        int i = 60;
    8.50 -        while (--i)
    8.51 -            swiWaitForVBlank();
    8.52 -    }
    8.53 -}
    8.54 -
    8.55 -
    8.56 int
    8.57 -main(void)
    8.58 -{
    8.59 -    SDL_Surface *screen;
    8.60 +	SDL_Window *window;
    8.61 +	SDL_Renderer *renderer;
    8.62      SDL_Joystick *stick;
    8.63      SDL_Event event;
    8.64      SDL_Rect rect = { 0, 0, 256, 192 };
    8.65 @@ -41,48 +36,48 @@
    8.66  
    8.67      consoleDemoInit();
    8.68      puts("Hello world!  Initializing FAT...");
    8.69 -    fatInitDefault();
    8.70 -    
    8.71 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) {
    8.72 +
    8.73 +    if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) {
    8.74          puts("# error initializing SDL");
    8.75          puts(SDL_GetError());
    8.76          return 1;
    8.77      }
    8.78      puts("* initialized SDL");
    8.79 -    screen = SDL_SetVideoMode(256, 192, 15, SDL_SWSURFACE);
    8.80 -    if (!screen) {
    8.81 -        puts("# error setting video mode");
    8.82 -        puts(SDL_GetError());
    8.83 -        return 2;
    8.84 +
    8.85 +    if (SDL_CreateWindowAndRenderer(256, 192, SDL_RENDERER_ACCELERATED, &window, &renderer) < 0 &&
    8.86 +		SDL_CreateWindowAndRenderer(256, 192, SDL_RENDERER_SOFTWARE, &window, &renderer) < 0) {
    8.87 +        exit(1);
    8.88      }
    8.89 -    screen->flags &= ~SDL_PREALLOC;
    8.90 -    puts("* set video mode");
    8.91 +
    8.92      stick = SDL_JoystickOpen(0);
    8.93      if (stick == NULL) {
    8.94          puts("# error opening joystick");
    8.95          puts(SDL_GetError());
    8.96 -//              return 3;
    8.97      }
    8.98      puts("* opened joystick");
    8.99  
   8.100 -    /*splash(screen, 3); */
   8.101 -
   8.102 -    SDL_FillRect(screen, &rect, RGB15(0, 0, 31) | 0x8000);
   8.103 -    SDL_Flip(screen);
   8.104 +    SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
   8.105 +    SDL_RenderFillRect(renderer, &rect);
   8.106 +    SDL_RenderPresent(renderer);
   8.107  
   8.108      while (1)
   8.109          while (SDL_PollEvent(&event))
   8.110              switch (event.type) {
   8.111              case SDL_JOYBUTTONDOWN:
   8.112 -                SDL_FillRect(screen, &rect, (u16) rand() | 0x8000);
   8.113 -                SDL_Flip(screen);
   8.114 +				
   8.115 +				SDL_SetRenderDrawColor(renderer, rand(), rand(), rand(), SDL_ALPHA_OPAQUE);
   8.116 +				SDL_RenderFillRect(renderer, &rect);
   8.117 +				SDL_RenderPresent(renderer);
   8.118                  if (rect.w > 8) {
   8.119                      rect.x += 4;
   8.120                      rect.y += 3;
   8.121                      rect.w -= 8;
   8.122                      rect.h -= 6;
   8.123                  }
   8.124 -                printf("button %d pressed at %d ticks\n",
   8.125 -                       event.jbutton.button, SDL_GetTicks());
   8.126 +				/*
   8.127 +				  printf("button %d pressed at %d ticks\n",
   8.128 +				  event.jbutton.button, SDL_GetTicks()); 
   8.129 +				*/
   8.130                  break;
   8.131              case SDL_QUIT:
   8.132                  SDL_Quit();
   8.133 @@ -90,7 +85,5 @@
   8.134              default:
   8.135                  break;
   8.136              }
   8.137 -    
   8.138 return 0;
   8.139 -
   8.140 }
   8.141 -
   8.142 -
   8.143 +    return 0;
   8.144 +}
     9.1 --- a/test/nds-test-progs/testscale/Makefile	Sun Feb 12 20:57:32 2012 -0500
     9.2 +++ b/test/nds-test-progs/testscale/Makefile	Sun Feb 12 21:04:01 2012 -0500
     9.3 @@ -42,7 +42,7 @@
     9.4  #---------------------------------------------------------------------------------
     9.5  # any extra libraries we wish to link with the project (order is important)
     9.6  #---------------------------------------------------------------------------------
     9.7 -LIBS	:= 	-lSDL -lgl2d -lfat -lnds9
     9.8 +LIBS	:= 	-lSDL -lfat -lnds9
     9.9  
    9.10  
    9.11  #---------------------------------------------------------------------------------
    10.1 --- a/test/nds-test-progs/testsprite2/Makefile	Sun Feb 12 20:57:32 2012 -0500
    10.2 +++ b/test/nds-test-progs/testsprite2/Makefile	Sun Feb 12 21:04:01 2012 -0500
    10.3 @@ -42,7 +42,7 @@
    10.4  #---------------------------------------------------------------------------------
    10.5  # any extra libraries we wish to link with the project (order is important)
    10.6  #---------------------------------------------------------------------------------
    10.7 -LIBS	:= 	-lSDL -lgl2d -lfat -lnds9
    10.8 +LIBS	:= 	-lSDL -lfat -lnds9
    10.9  
   10.10  
   10.11  #---------------------------------------------------------------------------------
    11.1 --- a/test/nds-test-progs/testspriteminimal/Makefile	Sun Feb 12 20:57:32 2012 -0500
    11.2 +++ b/test/nds-test-progs/testspriteminimal/Makefile	Sun Feb 12 21:04:01 2012 -0500
    11.3 @@ -42,7 +42,7 @@
    11.4  #---------------------------------------------------------------------------------
    11.5  # any extra libraries we wish to link with the project (order is important)
    11.6  #---------------------------------------------------------------------------------
    11.7 -LIBS	:= 	-lSDL -lgl2d -lfat -lnds9
    11.8 +LIBS	:= 	-lSDL -lfat -lnds9
    11.9  
   11.10  
   11.11  #---------------------------------------------------------------------------------