NDS update
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Mar 2011 21:28:17 -0700
changeset 5517aa339c0dca2d
parent 5516 89ad52a52876
child 5518 f84dd424d514
NDS update

Frank Zago to SDL

There's also a patch to adapt one test for the nds, and that adds several
makefiles to compile these tests. Whenever you apply it, could you completely
remove the test/nds-test-progs/sprite and test/nds-test-progs/sprite2
directories ?
test/common.c
test/common.h
test/nds-test-progs/testscale/Makefile
test/nds-test-progs/testsprite2/Makefile
test/nds-test-progs/testspriteminimal/Makefile
test/testspriteminimal.c
     1.1 --- a/test/common.c	Sat Mar 26 21:27:23 2011 -0700
     1.2 +++ b/test/common.c	Sat Mar 26 21:28:17 2011 -0700
     1.3 @@ -23,7 +23,11 @@
     1.4      /* Initialize some defaults */
     1.5      state->argv = argv;
     1.6      state->flags = flags;
     1.7 +#ifdef __NDS__
     1.8 +    state->window_title = "";
     1.9 +#else
    1.10      state->window_title = argv[0];
    1.11 +#endif
    1.12      state->window_flags = 0;
    1.13      state->window_x = SDL_WINDOWPOS_UNDEFINED;
    1.14      state->window_y = SDL_WINDOWPOS_UNDEFINED;
    1.15 @@ -62,6 +66,10 @@
    1.16  {
    1.17      char **argv = state->argv;
    1.18  
    1.19 +#ifdef __NDS__
    1.20 +    return 0;
    1.21 +#endif
    1.22 +
    1.23      if (SDL_strcasecmp(argv[index], "--video") == 0) {
    1.24          ++index;
    1.25          if (!argv[index]) {
     2.1 --- a/test/common.h	Sat Mar 26 21:27:23 2011 -0700
     2.2 +++ b/test/common.h	Sat Mar 26 21:28:17 2011 -0700
     2.3 @@ -4,8 +4,13 @@
     2.4  #define SDL_NO_COMPAT
     2.5  #include "SDL.h"
     2.6  
     2.7 +#ifdef __NDS__
     2.8 +#define DEFAULT_WINDOW_WIDTH  256
     2.9 +#define DEFAULT_WINDOW_HEIGHT (2*192)
    2.10 +#else
    2.11  #define DEFAULT_WINDOW_WIDTH  640
    2.12  #define DEFAULT_WINDOW_HEIGHT 480
    2.13 +#endif
    2.14  
    2.15  #define VERBOSE_VIDEO   0x00000001
    2.16  #define VERBOSE_MODES   0x00000002
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/nds-test-progs/testscale/Makefile	Sat Mar 26 21:28:17 2011 -0700
     3.3 @@ -0,0 +1,147 @@
     3.4 +#---------------------------------------------------------------------------------
     3.5 +.SUFFIXES:
     3.6 +#---------------------------------------------------------------------------------
     3.7 +
     3.8 +ifeq ($(strip $(DEVKITARM)),)
     3.9 +$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
    3.10 +endif
    3.11 +
    3.12 +include $(DEVKITARM)/ds_rules
    3.13 +
    3.14 +#---------------------------------------------------------------------------------
    3.15 +# TARGET is the name of the output
    3.16 +# BUILD is the directory where object files & intermediate files will be placed
    3.17 +# SOURCES is a list of directories containing source code
    3.18 +# INCLUDES is a list of directories containing extra header files
    3.19 +# DATA is a list of directories containing binary files embedded using bin2o
    3.20 +# GRAPHICS is a list of directories containing image files to be converted with grit
    3.21 +#---------------------------------------------------------------------------------
    3.22 +TARGET		:=	$(shell basename $(CURDIR))
    3.23 +BUILD		:=	build
    3.24 +SOURCES		:=	source
    3.25 +INCLUDES	:=	include ../..
    3.26 +DATA		:=	data  
    3.27 +GRAPHICS	:=	gfx  
    3.28 +
    3.29 +#---------------------------------------------------------------------------------
    3.30 +# options for code generation
    3.31 +#---------------------------------------------------------------------------------
    3.32 +ARCH	:=	-mthumb -mthumb-interwork -march=armv5te -mtune=arm946e-s
    3.33 +
    3.34 +CFLAGS	:=	-g -Wall -O2\
    3.35 +		-fomit-frame-pointer\
    3.36 +		-ffast-math \
    3.37 +		$(ARCH)
    3.38 +
    3.39 +CFLAGS	+=	$(INCLUDE) -DARM9 -D__NDS__
    3.40 +CXXFLAGS	:= $(CFLAGS) -fno-rtti -fno-exceptions
    3.41 +
    3.42 +ASFLAGS	:=	-g $(ARCH)
    3.43 +LDFLAGS	=	-specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
    3.44 +
    3.45 +#---------------------------------------------------------------------------------
    3.46 +# any extra libraries we wish to link with the project (order is important)
    3.47 +#---------------------------------------------------------------------------------
    3.48 +LIBS	:= 	-lSDL -lgl2d -lfat -lnds9
    3.49 +
    3.50 +
    3.51 +#---------------------------------------------------------------------------------
    3.52 +# list of directories containing libraries, this must be the top level containing
    3.53 +# include and lib
    3.54 +#---------------------------------------------------------------------------------
    3.55 +LIBDIRS	:=	$(LIBNDS) $(PORTLIBS)
    3.56 +
    3.57 +#---------------------------------------------------------------------------------
    3.58 +# no real need to edit anything past this point unless you need to add additional
    3.59 +# rules for different file extensions
    3.60 +#---------------------------------------------------------------------------------
    3.61 +ifneq ($(BUILD),$(notdir $(CURDIR)))
    3.62 +#---------------------------------------------------------------------------------
    3.63 +
    3.64 +export OUTPUT	:=	$(CURDIR)/$(TARGET)
    3.65 +
    3.66 +export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
    3.67 +					$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
    3.68 +					$(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir))
    3.69 +
    3.70 +export DEPSDIR	:=	$(CURDIR)/$(BUILD)
    3.71 +
    3.72 +CFILES		:=	../../../common.c ../../../testscale.c
    3.73 +
    3.74 +#---------------------------------------------------------------------------------
    3.75 +# use CXX for linking C++ projects, CC for standard C
    3.76 +#---------------------------------------------------------------------------------
    3.77 +ifeq ($(strip $(CPPFILES)),)
    3.78 +#---------------------------------------------------------------------------------
    3.79 +	export LD	:=	$(CC)
    3.80 +#---------------------------------------------------------------------------------
    3.81 +else
    3.82 +#---------------------------------------------------------------------------------
    3.83 +	export LD	:=	$(CXX)
    3.84 +#---------------------------------------------------------------------------------
    3.85 +endif
    3.86 +#---------------------------------------------------------------------------------
    3.87 +
    3.88 +export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
    3.89 +					$(PNGFILES:.png=.o) \
    3.90 +					$(BMPFILES:.bmp=.o) \
    3.91 +					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
    3.92 +
    3.93 +export INCLUDE	:=	$(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir)) \
    3.94 +					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
    3.95 +					-I$(CURDIR)/$(BUILD) \
    3.96 +					-I$(PORTLIBS)/include/SDL
    3.97 +
    3.98 +export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib)
    3.99 +
   3.100 +.PHONY: $(BUILD) clean
   3.101 +
   3.102 +#---------------------------------------------------------------------------------
   3.103 +$(BUILD):
   3.104 +	@[ -d $@ ] || mkdir -p $@
   3.105 +	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
   3.106 +
   3.107 +#---------------------------------------------------------------------------------
   3.108 +clean:
   3.109 +	@echo clean ...
   3.110 +	@rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds
   3.111 +
   3.112 +#---------------------------------------------------------------------------------
   3.113 +else
   3.114 +
   3.115 +DEPENDS :=  $(OFILES:.o=.d)
   3.116 +
   3.117 +#---------------------------------------------------------------------------------
   3.118 +# main targets
   3.119 +#---------------------------------------------------------------------------------
   3.120 +$(OUTPUT).nds	: 	$(OUTPUT).elf
   3.121 +$(OUTPUT).elf	:	$(OFILES)
   3.122 +
   3.123 +#---------------------------------------------------------------------------------
   3.124 +%.bin.o	:	%.bin
   3.125 +#---------------------------------------------------------------------------------
   3.126 +	@echo $(notdir $<)
   3.127 +	$(bin2o)
   3.128 +
   3.129 +#---------------------------------------------------------------------------------
   3.130 +# This rule creates assembly source files using grit
   3.131 +# grit takes an image file and a .grit describing how the file is to be processed
   3.132 +# add additional rules like this for each image extension
   3.133 +# you use in the graphics folders
   3.134 +#---------------------------------------------------------------------------------
   3.135 +%.s %.h	: %.bmp %.grit
   3.136 +#---------------------------------------------------------------------------------
   3.137 +	grit $< -fts -o$*
   3.138 +
   3.139 +
   3.140 +#---------------------------------------------------------------------------------
   3.141 +%.s %.h : %.png %.grit
   3.142 +#---------------------------------------------------------------------------------
   3.143 +	grit $< -fts -o$*
   3.144 +
   3.145 +
   3.146 +-include $(DEPENDS)
   3.147 +
   3.148 +#---------------------------------------------------------------------------------------
   3.149 +endif
   3.150 +#---------------------------------------------------------------------------------------
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/nds-test-progs/testsprite2/Makefile	Sat Mar 26 21:28:17 2011 -0700
     4.3 @@ -0,0 +1,152 @@
     4.4 +#---------------------------------------------------------------------------------
     4.5 +.SUFFIXES:
     4.6 +#---------------------------------------------------------------------------------
     4.7 +
     4.8 +ifeq ($(strip $(DEVKITARM)),)
     4.9 +$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
    4.10 +endif
    4.11 +
    4.12 +include $(DEVKITARM)/ds_rules
    4.13 +
    4.14 +#---------------------------------------------------------------------------------
    4.15 +# TARGET is the name of the output
    4.16 +# BUILD is the directory where object files & intermediate files will be placed
    4.17 +# SOURCES is a list of directories containing source code
    4.18 +# INCLUDES is a list of directories containing extra header files
    4.19 +# DATA is a list of directories containing binary files embedded using bin2o
    4.20 +# GRAPHICS is a list of directories containing image files to be converted with grit
    4.21 +#---------------------------------------------------------------------------------
    4.22 +TARGET		:=	$(shell basename $(CURDIR))
    4.23 +BUILD		:=	build
    4.24 +SOURCES		:=	source
    4.25 +INCLUDES	:=	include ../..
    4.26 +DATA		:=	data  
    4.27 +GRAPHICS	:=	gfx  
    4.28 +
    4.29 +#---------------------------------------------------------------------------------
    4.30 +# options for code generation
    4.31 +#---------------------------------------------------------------------------------
    4.32 +ARCH	:=	-mthumb -mthumb-interwork -march=armv5te -mtune=arm946e-s
    4.33 +
    4.34 +CFLAGS	:=	-g -Wall -O2\
    4.35 +		-fomit-frame-pointer\
    4.36 +		-ffast-math \
    4.37 +		$(ARCH)
    4.38 +
    4.39 +CFLAGS	+=	$(INCLUDE) -DARM9 -D__NDS__
    4.40 +CXXFLAGS	:= $(CFLAGS) -fno-rtti -fno-exceptions
    4.41 +
    4.42 +ASFLAGS	:=	-g $(ARCH)
    4.43 +LDFLAGS	=	-specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
    4.44 +
    4.45 +#---------------------------------------------------------------------------------
    4.46 +# any extra libraries we wish to link with the project (order is important)
    4.47 +#---------------------------------------------------------------------------------
    4.48 +LIBS	:= 	-lSDL -lgl2d -lfat -lnds9
    4.49 +
    4.50 +
    4.51 +#---------------------------------------------------------------------------------
    4.52 +# list of directories containing libraries, this must be the top level containing
    4.53 +# include and lib
    4.54 +#---------------------------------------------------------------------------------
    4.55 +LIBDIRS	:=	$(LIBNDS) $(PORTLIBS)
    4.56 + 
    4.57 +#---------------------------------------------------------------------------------
    4.58 +# no real need to edit anything past this point unless you need to add additional
    4.59 +# rules for different file extensions
    4.60 +#---------------------------------------------------------------------------------
    4.61 +ifneq ($(BUILD),$(notdir $(CURDIR)))
    4.62 +#---------------------------------------------------------------------------------
    4.63 +
    4.64 +export OUTPUT	:=	$(CURDIR)/$(TARGET)
    4.65 +
    4.66 +export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
    4.67 +					$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
    4.68 +					$(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir))
    4.69 +
    4.70 +export DEPSDIR	:=	$(CURDIR)/$(BUILD)
    4.71 +
    4.72 +CFILES		:=	../../../common.c ../../../testsprite2.c
    4.73 +CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
    4.74 +SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
    4.75 +PNGFILES	:=	$(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png)))
    4.76 +BMPFILES    :=  $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.bmp)))
    4.77 +BINFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
    4.78 + 
    4.79 +#---------------------------------------------------------------------------------
    4.80 +# use CXX for linking C++ projects, CC for standard C
    4.81 +#---------------------------------------------------------------------------------
    4.82 +ifeq ($(strip $(CPPFILES)),)
    4.83 +#---------------------------------------------------------------------------------
    4.84 +	export LD	:=	$(CC)
    4.85 +#---------------------------------------------------------------------------------
    4.86 +else
    4.87 +#---------------------------------------------------------------------------------
    4.88 +	export LD	:=	$(CXX)
    4.89 +#---------------------------------------------------------------------------------
    4.90 +endif
    4.91 +#---------------------------------------------------------------------------------
    4.92 +
    4.93 +export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
    4.94 +					$(PNGFILES:.png=.o) \
    4.95 +					$(BMPFILES:.bmp=.o) \
    4.96 +					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
    4.97 +
    4.98 +export INCLUDE	:=	$(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir)) \
    4.99 +					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
   4.100 +					-I$(CURDIR)/$(BUILD) \
   4.101 +					-I$(PORTLIBS)/include/SDL
   4.102 +
   4.103 +export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib)
   4.104 +
   4.105 +.PHONY: $(BUILD) clean
   4.106 +
   4.107 +#---------------------------------------------------------------------------------
   4.108 +$(BUILD):
   4.109 +	@[ -d $@ ] || mkdir -p $@
   4.110 +	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
   4.111 + 
   4.112 +#---------------------------------------------------------------------------------
   4.113 +clean:
   4.114 +	@echo clean ...
   4.115 +	@rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds
   4.116 +
   4.117 +#---------------------------------------------------------------------------------
   4.118 +else
   4.119 +
   4.120 +DEPENDS :=  $(OFILES:.o=.d)
   4.121 + 
   4.122 +#---------------------------------------------------------------------------------
   4.123 +# main targets
   4.124 +#---------------------------------------------------------------------------------
   4.125 +$(OUTPUT).nds	: 	$(OUTPUT).elf
   4.126 +$(OUTPUT).elf	:	$(OFILES)
   4.127 + 
   4.128 +#---------------------------------------------------------------------------------
   4.129 +%.bin.o	:	%.bin
   4.130 +#---------------------------------------------------------------------------------
   4.131 +	@echo $(notdir $<)
   4.132 +	$(bin2o)
   4.133 +
   4.134 +#---------------------------------------------------------------------------------
   4.135 +# This rule creates assembly source files using grit
   4.136 +# grit takes an image file and a .grit describing how the file is to be processed
   4.137 +# add additional rules like this for each image extension
   4.138 +# you use in the graphics folders
   4.139 +#---------------------------------------------------------------------------------
   4.140 +%.s %.h	: %.bmp %.grit
   4.141 +#---------------------------------------------------------------------------------
   4.142 +	grit $< -fts -o$*
   4.143 +
   4.144 +
   4.145 +#---------------------------------------------------------------------------------
   4.146 +%.s %.h : %.png %.grit
   4.147 +#---------------------------------------------------------------------------------
   4.148 +	grit $< -fts -o$*
   4.149 +
   4.150 +
   4.151 +-include $(DEPENDS)
   4.152 +
   4.153 +#---------------------------------------------------------------------------------------
   4.154 +endif
   4.155 +#---------------------------------------------------------------------------------------
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/nds-test-progs/testspriteminimal/Makefile	Sat Mar 26 21:28:17 2011 -0700
     5.3 @@ -0,0 +1,147 @@
     5.4 +#---------------------------------------------------------------------------------
     5.5 +.SUFFIXES:
     5.6 +#---------------------------------------------------------------------------------
     5.7 +
     5.8 +ifeq ($(strip $(DEVKITARM)),)
     5.9 +$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
    5.10 +endif
    5.11 +
    5.12 +include $(DEVKITARM)/ds_rules
    5.13 +
    5.14 +#---------------------------------------------------------------------------------
    5.15 +# TARGET is the name of the output
    5.16 +# BUILD is the directory where object files & intermediate files will be placed
    5.17 +# SOURCES is a list of directories containing source code
    5.18 +# INCLUDES is a list of directories containing extra header files
    5.19 +# DATA is a list of directories containing binary files embedded using bin2o
    5.20 +# GRAPHICS is a list of directories containing image files to be converted with grit
    5.21 +#---------------------------------------------------------------------------------
    5.22 +TARGET		:=	$(shell basename $(CURDIR))
    5.23 +BUILD		:=	build
    5.24 +SOURCES		:=	source
    5.25 +INCLUDES	:=	include
    5.26 +DATA		:=	data  
    5.27 +GRAPHICS	:=	gfx  
    5.28 +
    5.29 +#---------------------------------------------------------------------------------
    5.30 +# options for code generation
    5.31 +#---------------------------------------------------------------------------------
    5.32 +ARCH	:=	-mthumb -mthumb-interwork -march=armv5te -mtune=arm946e-s
    5.33 +
    5.34 +CFLAGS	:=	-g -Wall -O2\
    5.35 +		-fomit-frame-pointer\
    5.36 +		-ffast-math \
    5.37 +		$(ARCH)
    5.38 +
    5.39 +CFLAGS	+=	$(INCLUDE) -DARM9 -D__NDS__
    5.40 +CXXFLAGS	:= $(CFLAGS) -fno-rtti -fno-exceptions
    5.41 +
    5.42 +ASFLAGS	:=	-g $(ARCH)
    5.43 +LDFLAGS	=	-specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
    5.44 +
    5.45 +#---------------------------------------------------------------------------------
    5.46 +# any extra libraries we wish to link with the project (order is important)
    5.47 +#---------------------------------------------------------------------------------
    5.48 +LIBS	:= 	-lSDL -lgl2d -lfat -lnds9
    5.49 +
    5.50 +
    5.51 +#---------------------------------------------------------------------------------
    5.52 +# list of directories containing libraries, this must be the top level containing
    5.53 +# include and lib
    5.54 +#---------------------------------------------------------------------------------
    5.55 +LIBDIRS	:=	$(LIBNDS) $(PORTLIBS)
    5.56 +
    5.57 +#---------------------------------------------------------------------------------
    5.58 +# no real need to edit anything past this point unless you need to add additional
    5.59 +# rules for different file extensions
    5.60 +#---------------------------------------------------------------------------------
    5.61 +ifneq ($(BUILD),$(notdir $(CURDIR)))
    5.62 +#---------------------------------------------------------------------------------
    5.63 +
    5.64 +export OUTPUT	:=	$(CURDIR)/$(TARGET)
    5.65 +
    5.66 +export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
    5.67 +					$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
    5.68 +					$(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir))
    5.69 +
    5.70 +export DEPSDIR	:=	$(CURDIR)/$(BUILD)
    5.71 +
    5.72 +CFILES		:=	../../../testspriteminimal.c
    5.73 +
    5.74 +#---------------------------------------------------------------------------------
    5.75 +# use CXX for linking C++ projects, CC for standard C
    5.76 +#---------------------------------------------------------------------------------
    5.77 +ifeq ($(strip $(CPPFILES)),)
    5.78 +#---------------------------------------------------------------------------------
    5.79 +	export LD	:=	$(CC)
    5.80 +#---------------------------------------------------------------------------------
    5.81 +else
    5.82 +#---------------------------------------------------------------------------------
    5.83 +	export LD	:=	$(CXX)
    5.84 +#---------------------------------------------------------------------------------
    5.85 +endif
    5.86 +#---------------------------------------------------------------------------------
    5.87 +
    5.88 +export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
    5.89 +					$(PNGFILES:.png=.o) \
    5.90 +					$(BMPFILES:.bmp=.o) \
    5.91 +					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
    5.92 +
    5.93 +export INCLUDE	:=	$(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir)) \
    5.94 +					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
    5.95 +					-I$(CURDIR)/$(BUILD) \
    5.96 +					-I$(PORTLIBS)/include/SDL
    5.97 +
    5.98 +export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib)
    5.99 +
   5.100 +.PHONY: $(BUILD) clean
   5.101 +
   5.102 +#---------------------------------------------------------------------------------
   5.103 +$(BUILD):
   5.104 +	@[ -d $@ ] || mkdir -p $@
   5.105 +	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
   5.106 +
   5.107 +#---------------------------------------------------------------------------------
   5.108 +clean:
   5.109 +	@echo clean ...
   5.110 +	@rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds
   5.111 +
   5.112 +#---------------------------------------------------------------------------------
   5.113 +else
   5.114 +
   5.115 +DEPENDS :=  $(OFILES:.o=.d)
   5.116 +
   5.117 +#---------------------------------------------------------------------------------
   5.118 +# main targets
   5.119 +#---------------------------------------------------------------------------------
   5.120 +$(OUTPUT).nds	: 	$(OUTPUT).elf
   5.121 +$(OUTPUT).elf	:	$(OFILES)
   5.122 +
   5.123 +#---------------------------------------------------------------------------------
   5.124 +%.bin.o	:	%.bin
   5.125 +#---------------------------------------------------------------------------------
   5.126 +	@echo $(notdir $<)
   5.127 +	$(bin2o)
   5.128 +
   5.129 +#---------------------------------------------------------------------------------
   5.130 +# This rule creates assembly source files using grit
   5.131 +# grit takes an image file and a .grit describing how the file is to be processed
   5.132 +# add additional rules like this for each image extension
   5.133 +# you use in the graphics folders
   5.134 +#---------------------------------------------------------------------------------
   5.135 +%.s %.h	: %.bmp %.grit
   5.136 +#---------------------------------------------------------------------------------
   5.137 +	grit $< -fts -o$*
   5.138 +
   5.139 +
   5.140 +#---------------------------------------------------------------------------------
   5.141 +%.s %.h : %.png %.grit
   5.142 +#---------------------------------------------------------------------------------
   5.143 +	grit $< -fts -o$*
   5.144 +
   5.145 +
   5.146 +-include $(DEPENDS)
   5.147 +
   5.148 +#---------------------------------------------------------------------------------------
   5.149 +endif
   5.150 +#---------------------------------------------------------------------------------------
     6.1 --- a/test/testspriteminimal.c	Sat Mar 26 21:27:23 2011 -0700
     6.2 +++ b/test/testspriteminimal.c	Sat Mar 26 21:28:17 2011 -0700
     6.3 @@ -6,8 +6,13 @@
     6.4  
     6.5  #include "SDL.h"
     6.6  
     6.7 +#ifdef __NDS__
     6.8 +#define WINDOW_WIDTH    256
     6.9 +#define WINDOW_HEIGHT   (2*192)
    6.10 +#else
    6.11  #define WINDOW_WIDTH    640
    6.12  #define WINDOW_HEIGHT   480
    6.13 +#endif
    6.14  #define NUM_SPRITES     100
    6.15  #define MAX_SPEED       1
    6.16