[Scummvm-cvs-logs] SF.net SVN: scummvm:[50672] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Jul 5 12:07:33 CEST 2010


Revision: 50672
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50672&view=rev
Author:   fingolfin
Date:     2010-07-05 10:07:33 +0000 (Mon, 05 Jul 2010)

Log Message:
-----------
DS: Can now build binaries via our "configure/make" build system.

Conversion of the old build system is incomplete. Binaries created
using this new build system support most likely will not run!
More work is needed, but the work done so far should be enough
to get basic NDS support on our buildbot working.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/ds/arm9/makefile
    scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp
    scummvm/trunk/backends/platform/ds/ds.mk
    scummvm/trunk/backends/platform/ds/module.mk
    scummvm/trunk/configure

Modified: scummvm/trunk/backends/platform/ds/arm9/makefile
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/makefile	2010-07-05 10:07:06 UTC (rev 50671)
+++ scummvm/trunk/backends/platform/ds/arm9/makefile	2010-07-05 10:07:33 UTC (rev 50672)
@@ -202,7 +202,6 @@
 #endif
 
 ARM7BIN	:= -7 $(CURDIR)/../../arm7/arm7.bin
-ICON		:= -b ../../../logo.bmp "ScummVM;By Neil Millstone;"
 
 CC      = arm-eabi-gcc
 CXX     = arm-eabi-g++

Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2010-07-05 10:07:06 UTC (rev 50671)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2010-07-05 10:07:33 UTC (rev 50672)
@@ -97,7 +97,7 @@
 #endif
 #include "ramsave.h"
 #include "blitters.h"
-#include "cartreset_nolibfat.h"
+#include "libcartreset/cartreset_nolibfat.h"
 #include "keys.h"
 #ifdef USE_PROFILER
 #include "profiler/cyg-profile.h"
@@ -3344,6 +3344,11 @@
 	const char *argv[] = {"/scummvmds", "--config=scummvmj.ini"};
 #elif defined(DS_BUILD_K)
 	const char *argv[] = {"/scummvmds", "--config=scummvmk.ini"};
+#else
+	// Use the default config file if no build was specified. This currently
+	// only happens with builds made using the regular ScummVM build system (as
+	// opposed to the nds specific build system).
+	const char *argv[] = {"/scummvmds"};
 #endif
 
 

Modified: scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp	2010-07-05 10:07:06 UTC (rev 50671)
+++ scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp	2010-07-05 10:07:33 UTC (rev 50672)
@@ -66,6 +66,11 @@
 #define DEFAULT_CONFIG_FILE "scummvmj.ini"
 #elif defined(DS_BUILD_K)
 #define DEFAULT_CONFIG_FILE "scummvmk.ini"
+#else
+	// Use the "scummvm.ini" as config file if no build was specified. This
+	// currently only happens with builds made using the regular ScummVM build
+	// system (as opposed to the nds specific build system).
+#define DEFAULT_CONFIG_FILE "scummvm.ini"
 #endif
 
 OSystem_DS* OSystem_DS::_instance = NULL;

Modified: scummvm/trunk/backends/platform/ds/ds.mk
===================================================================
--- scummvm/trunk/backends/platform/ds/ds.mk	2010-07-05 10:07:06 UTC (rev 50671)
+++ scummvm/trunk/backends/platform/ds/ds.mk	2010-07-05 10:07:33 UTC (rev 50672)
@@ -1,9 +1,65 @@
-# Repeat "all" target here, to make sure it is the first target
-# Currently disabled, so only arm7.bin gets build
-#all:
+# To approximate the DS builds A, B, C, ... run our configure like this
+#   configure --host=ds --disable-all-engines OPTIONS
+# where OPTIONS is...
+# build A:  --enable-scumm
+# build B:  --enable-sky --enable-queen
+# build C:  --enable-ago
+# build D:  --enable-gob --enable-cine --enable-agi
+# build E:  --enable-saga --disable-mad
+# build F:  --enable-kyra --disable-mad
+# build G:  --enable-lure
+# build H:  --enable-parallaction
+# build I:  --enable-made --disable-mad
+# build K:  --enable-cruise --disable-mad
+#
+# This does not currently take care of some things:
+# * It does not #define DS_BUILD_A etc. -- most uses of that should be
+#   eliminated, though. Only usage should be for selecting the default config
+#   file (and for that we should really rather allow overriding the value of
+#   DEFAULT_CONFIG_FILE).
+#   There are a few game specific hacks which are currently controlled by this,
+#   too; we need to investigate those.
+# * It does not currently adjust the logo. Ideally, if we ever get real plugin
+#   support, that should be necessary anymore anyway.
+# * ...
 
+# Set location of ndsdir so that we can easily refer to files in it
+ndsdir = backends/platform/ds
 
 
+# Until we fix logo support, always use the A logo
+LOGO = logoa.bmp
+
+# Uncomment the following line to enable support for the
+# ace DS Debugger (remembering to make the same change in the arm7 makefile):
+#USE_DEBUGGER = 1
+# TODO: Need to reimplement this (for arm9 and arm7).
+#ifdef USE_DEBUGGER
+#	DEFINES += -DUSE_DEBUGGER
+#	CFLAGS += -g
+#endif
+
+# Uncomment the following line to enable the profiler
+#USE_PROFILER = 1
+# TODO: Need to reimplement this; and maybe replace it by the --enable-profiling
+#       configure directive. Below is USE_PROFILER related code from the old NDS
+#       build system:
+#ifdef USE_PROFILER
+#	CFLAGS += -mpoke-function-name -finstrument-functions -g
+#	DEFINES += -DUSE_PROFILER
+#endif
+# And this for module.mk:
+#ifdef USE_PROFILER
+#	PORT_OBJS += arm9/source/profiler/cyg-profile.o
+#endif
+
+
+
+# NOTE: The header and libs for the debugger is assumed to be in the libnds
+# folder.
+
+
+
 # Files in this list will be optimisied for speed, otherwise they will be optimised for space
 OPTLIST := actor.cpp ds_main.cpp osystem_ds.cpp blitters.cpp fmopl.cpp rate.cpp isomap.cpp image.cpp gfx.cpp sprite.cpp actor_path.cpp actor_walk.cpp
 #OPTLIST :=
@@ -28,17 +84,26 @@
 
 
 
+#############################################################################
+#
+# ARM9 rules.
+#
+#############################################################################
 
+all: scummvm.nds scummvm.ds.gba
 
+%.nds: %.bin $(ndsdir)/arm7/arm7.bin
+	ndstool -c $@ -9 $< -7 $(ndsdir)/arm7/arm7.bin -b $(srcdir)/$(ndsdir)/$(LOGO) "$(@F);ScummVM $(VERSION);DS Port"
 
+%.ds.gba: %.nds
+	dsbuild $< -o $@ -l $(srcdir)/$(ndsdir)/arm9/ndsloader.bin
+	padbin 16 $@
+
 #############################################################################
 #############################################################################
 #############################################################################
 
 
-#ndsdir = $(srcdir)/backends/platform/ds
-ndsdir = backends/platform/ds
-
 #############################################################################
 #
 # ARM7 rules.
@@ -47,12 +112,6 @@
 #
 #############################################################################
 
-$(ndsdir)/arm7/arm7.bin: $(ndsdir)/arm7/arm7.elf
-
-$(ndsdir)/arm7/arm7.elf: \
-	$(ndsdir)/arm7/source/libcartreset/cartreset.o \
-	$(ndsdir)/arm7/source/main.o
-
 # HACK/FIXME: C compiler, for cartreset.c -- we should switch this to use CXX
 # as soon as possible.
 CC := $(DEVKITARM)/bin/arm-eabi-gcc
@@ -89,7 +148,6 @@
 	$(MKDIR) $(*D)/$(DEPDIR)
 	$(CC) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
 
-
 # Set custom build flags for cartreset.o
 $(ndsdir)/arm7/source/libcartreset/cartreset.o: CXXFLAGS=$(ARM7_CFLAGS)
 $(ndsdir)/arm7/source/libcartreset/cartreset.o: CPPFLAGS=
@@ -98,14 +156,28 @@
 $(ndsdir)/arm7/source/main.o: CXXFLAGS=$(ARM7_CXXFLAGS)
 $(ndsdir)/arm7/source/main.o: CPPFLAGS=
 
+# Rule for creating ARM7 .elf files by linking .o files together with a special linker script
+$(ndsdir)/arm7/arm7.elf: \
+	$(ndsdir)/arm7/source/libcartreset/cartreset.o \
+	$(ndsdir)/arm7/source/main.o
+	$(CXX) $(ARM7_LDFLAGS) -specs=ds_arm7.specs $+ -L$(DEVKITPRO)/libnds/lib -lnds7  -o $@
+
 # Rule for creating ARM7 .bin files from .elf files
-#%.bin: %.elf
-#	@echo ------
-#	@echo Building $@...
-#	$(OBJCOPY) -O binary  $< $@
+$(ndsdir)/arm7/arm7.bin: $(ndsdir)/arm7/arm7.elf
+	$(OBJCOPY) -O binary  $< $@
 
-# Rule for creating ARM7 .elf files by linking .o files together with a special linker script
-%.elf:
-	@echo ------
-	@echo Building $@...
-	$(CXX)  $(ARM7_LDFLAGS) -specs=ds_arm7.specs $+ -L/opt/devkitPro/libnds/lib -lnds7  -o $@
+
+
+
+
+
+
+# Command to build libmad is:
+# ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork'
+#
+# I actually had to use
+# ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork' LDFLAGS='C:/Progra~1/devkitpro/libnds/lib/libnds9.a' --disable-shared --disable-debugging
+#
+# Fingolfin used
+# CXX=arm-eabi-g++ CC=arm-eabi-gcc ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork' --disable-shared --disable-debugging LDFLAGS=$DEVKITPRO/libnds/lib/libnds9.a
+

Modified: scummvm/trunk/backends/platform/ds/module.mk
===================================================================
--- scummvm/trunk/backends/platform/ds/module.mk	2010-07-05 10:07:06 UTC (rev 50671)
+++ scummvm/trunk/backends/platform/ds/module.mk	2010-07-05 10:07:33 UTC (rev 50672)
@@ -21,10 +21,6 @@
 	arm9/source/wordcompletion.o \
 	arm9/source/interrupt.o
 
-ifdef USE_PROFILER
-	PORT_OBJS += arm9/source/profiler/cyg-profile.o
-endif
-
 DATA_OBJS := \
 	arm9/data/icons.o \
 	arm9/data/keyboard.o \
@@ -55,8 +51,8 @@
 #	arm9/source/fat/io_sd_common.o arm9/source/fat/io_scsd_s.o \
 #	arm9/source/fat/io_sc_common.o arm9/source/fat/io_sd_common.o
 
-LIBCARTRESET_OBJS := 
-	#arm9/source/libcartreset/cartreset.o
+LIBCARTRESET_OBJS := \
+#	arm9/source/libcartreset/cartreset.o
 
 
 #MODULE_OBJS := $(PORT_OBJS) $(DATA_OBJS) $(FAT_OBJS)
@@ -68,35 +64,56 @@
 #---------------------------------------------------------------------------------
 define bin2o
 	bin2s $< | $(AS) -mthumb -mthumb-interwork -o $(@)
-	echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h
-	echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h
-	echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(<F) | tr . _)`.h
 endef
 
-#---------------------------------------------------------------------------------
-%.o	:	%.bin
-#---------------------------------------------------------------------------------
-	@echo $(notdir $<)
-	@$(bin2o)
+define bin2h
+	echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > $@
+	echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> $@
+	echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> $@
+endef
 
-#---------------------------------------------------------------------------------
-%.o	:	%.raw
-#---------------------------------------------------------------------------------
-	@echo $(notdir $<)
-	@$(bin2o)
+vpath %.raw $(srcdir)
+vpath %.pal $(srcdir)
+vpath %.bin $(srcdir)
 
-#---------------------------------------------------------------------------------
-%.o	:	%.pal
-#---------------------------------------------------------------------------------
-	@echo $(notdir $<)
-	@$(bin2o)
+%.o: %.raw
+	$(bin2o)
 
+%_raw.h: %.raw
+	$(bin2h)
 
+%.o: %.pal
+	$(bin2o)
 
+%_raw.h: %.pal
+	$(bin2h)
 
-# TODO: Should add more dirs to MODULE_DIRS so that "make distclean" can remove .deps dirs.
+%.o: %.bin
+	$(bin2o)
+
+%_raw.h: %.bin
+	$(bin2h)
+
+
+# Mark files which require the *_raw.h files manually (for now, at least)
+$(MODULE)/arm9/source/dsmain.o: \
+	$(MODULE)/arm9/data/icons_raw.h \
+	$(MODULE)/arm9/data/keyboard_raw.h \
+	$(MODULE)/arm9/data/keyboard_pal_raw.h
+
+$(MODULE)/arm9/source/touchkeyboard.o: \
+	$(MODULE)/arm9/data/keyboard_raw.h \
+	$(MODULE)/arm9/data/keyboard_pal_raw.h \
+	$(MODULE)/arm9/data/8x8font_tga_raw.h
+
+
 MODULE_DIRS += \
-	backends/platform/ds/
+	backends/platform/ds \
+	backends/platform/ds/arm7/source \
+	backends/platform/ds/arm7/source/libcartreset \
+	backends/platform/ds/arm9/source \
+	backends/platform/ds/arm9/source/fat \
+	backends/platform/ds/arm9/source/libcartreset
 
 # We don't use the rules.mk here on purpose
 OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS)

Modified: scummvm/trunk/configure
===================================================================
--- scummvm/trunk/configure	2010-07-05 10:07:06 UTC (rev 50671)
+++ scummvm/trunk/configure	2010-07-05 10:07:33 UTC (rev 50672)
@@ -1392,7 +1392,12 @@
 		;;
 	ds)
 		# TODO Nintendo DS
-		DEFINES="$DEFINES -D__DS__ -DNDS -DARM9 -DARM -DNONSTANDARD_PORT -I$DEVKITPRO/libnds/include -isystem $DEVKITPRO/devkitARM/arm-eabi/include"
+		DEFINES="$DEFINES -D__DS__ -DNDS -DARM9 -DARM -DNONSTANDARD_PORT"
+		CXXFLAGS="$CXXFLAGS -isystem $DEVKITPRO/libnds/include -isystem $DEVKITPRO/devkitARM/arm-eabi/include"
+		CXXFLAGS="$CXXFLAGS -mthumb-interwork -ffunction-sections -fdata-sections -fno-strict-aliasing"
+		LDFLAGS="$LDFLAGS -specs=ds_arm9.specs -mthumb-interwork -mno-fpu -Wl,-Map,map.txt -Wl,--gc-sections"
+		LDFLAGS="$LDFLAGS -L$DEVKITPRO/libnds/lib"
+		LIBS="$LIBS -lnds9"
 		;;
 	os2-emx*)
 		DEFINES="$DEFINES -DUNIX"
@@ -1575,18 +1580,18 @@
 			DEFINES="$DEFINES -DDISABLE_FANCY_THEMES -DVECTOR_RENDERER_FORMAT=1555"
 			DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER"
 			DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE -DSTREAM_AUDIO_FROM_DISK"
+			DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL"
 			DEFINES="$DEFINES -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE"
 			_need_memalign=yes
+			add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
+			add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
+			add_line_to_config_mk 'USE_ARM_GFX_ASM = 1'
+			add_line_to_config_mk 'USE_ARM_COSTUME_ASM = 1'
+			add_line_to_config_mk 'USE_ARM_SCALER_ASM = 1'
 			_backend="ds"
 			_build_hq_scalers="no"
 			_mt32emu="no"
 			_port_mk="backends/platform/ds/ds.mk"
-			# TODO: Enable more ARM optimizations -- requires testing!
-			add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
-			add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
-			#add_line_to_config_mk 'USE_ARM_GFX_ASM = 1'
-			#add_line_to_config_mk 'USE_ARM_COSTUME_ASM = 1'
-			#add_line_to_config_mk 'USE_ARM_SCALER_ASM = 1'
 			;;
 		neuros)
 			DEFINES="$DEFINES -DUNIX -DNEUROS"
@@ -2445,7 +2450,9 @@
 		;;
 	ds)
 		# TODO ds
-		INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/arm9/source -I$(srcdir)/backends/platform/ds/commoninclude'
+		INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/arm9/source'
+		INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/commoninclude'
+		INCLUDES="$INCLUDES "'-Ibackends/platform/ds/arm9/data'
 		;;
 	null)
 		DEFINES="$DEFINES -DUSE_NULL_DRIVER"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list