aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ds
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/ds')
-rw-r--r--backends/platform/ds/arm9/makefile6
-rw-r--r--backends/platform/ds/arm9/source/portdefs.h20
-rw-r--r--backends/platform/ds/ds.mk53
-rwxr-xr-xbackends/platform/ds/setup-builddirs.sh57
4 files changed, 108 insertions, 28 deletions
diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile
index fac50178b4..eedf75c256 100644
--- a/backends/platform/ds/arm9/makefile
+++ b/backends/platform/ds/arm9/makefile
@@ -205,7 +205,6 @@ CXX = arm-eabi-g++
LD = arm-eabi-g++
CFLAGS = -Wno-multichar -Wall\
- -Wno-multichar -mcpu=arm9tdmi -mtune=arm9tdmi \
-mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
-mthumb-interwork -DUSE_ARM_COSTUME_ASM=1 -DDISABLE_SID
@@ -281,7 +280,6 @@ PORT_OBJS := \
$(portdir)/source/blitters_arm.o \
$(portdir)/source/cdaudio.o \
$(portdir)/source/dsmain.o \
- $(portdir)/../../../fs/ds/ds-fs.o \
$(portdir)/source/gbampsave.o \
$(portdir)/source/scummhelp.o \
$(portdir)/source/osystem_ds.o \
@@ -297,14 +295,14 @@ ifdef USE_PROFILER
endif
-DATA_OBJS :=
+DATA_OBJS := \
$(portdir)/data/icons.o \
$(portdir)/data/keyboard.o \
$(portdir)/data/keyboard_pal.o \
$(portdir)/data/default_font.o \
$(portdir)/data/8x8font_tga.o
-FAT_OBJS :=
+FAT_OBJS := \
$(portdir)/source/fat/disc_io.o \
$(portdir)/source/fat/gba_nds_fat.o \
$(portdir)/source/fat/io_fcsr.o \
diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h
index bdb42993d1..cc38d66a73 100644
--- a/backends/platform/ds/arm9/source/portdefs.h
+++ b/backends/platform/ds/arm9/source/portdefs.h
@@ -26,6 +26,9 @@
#ifndef _PORTDEFS_H_
#define _PORTDEFS_H_
+// Include ndstypes.h for uint16 etc. typedefs
+#include "nds/ndstypes.h"
+
// Somebody removed these from scummsys.h, but they're still required, so I'm
// adding them here in the hope that they'll stay.
#include <stdio.h>
@@ -49,6 +52,7 @@
#define STREAM_AUDIO_FROM_DISK
#endif
+// FIXME: What is "NO_DEBUG_MSGS" good for?
#define NO_DEBUG_MSGS
// This is defined in dsmain.cpp
@@ -65,16 +69,22 @@ void consolePrintf(const char *format, ...);
#undef assert
#endif
+#ifdef NDEBUG
+
+#define assert(e) ((void)0)
+
+#else
+
+// FIXME: Shouldn't assert() also bail out / exit / halt the program? Right now we just
+// print an error message...
#define assert(s) \
do { \
- if (!(s)) \
+ if (!(s)) { \
consolePrintf("Assertion failed: '##s##' at file %s, line %d\n", __FILE__, __LINE__); \
+ } \
} while (0)
-//#include "ds-fs.h"
-
-//#define debug(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__)
-//#define debug(fmt, ...) debug(0, fmt, ##__VA_ARGS__)
+#endif
// FIXME: Since I can't change the engine at the moment (post lockdown) this define can go here.
// This define changes the mouse-relative motion which doesn't make sense on a touch screen to
diff --git a/backends/platform/ds/ds.mk b/backends/platform/ds/ds.mk
index 97f104c391..a9ed3e0096 100644
--- a/backends/platform/ds/ds.mk
+++ b/backends/platform/ds/ds.mk
@@ -75,7 +75,7 @@ endif
# Compiler options for files which should be optimised for speed
-OPT_SPEED := -O3
+OPT_SPEED := -O3 -mno-thumb
# Compiler options for files which should be optimised for space
OPT_SIZE := -Os -mthumb
@@ -83,31 +83,46 @@ OPT_SIZE := -Os -mthumb
# By default optimize for size
CXXFLAGS += $(OPT_SIZE)
-# Files listed below will be optimisied for speed, otherwise they will be optimised for space
-# TODO: speed original list contained three more files that should be optimized
-# for speed: actor.cpp gfx.cpp sprite.cpp -- but there are many files with these
-# names, which are the "right" ones?
+# Files listed below will be optimisied for speed, otherwise they will be optimised for space.
+# TODO: Several of these files probably should not be optimized for speed, but for now
+# we replicate the *precise* list from the old DS makefile, to ensure full compatibility.
+# Eventually, we should tune this list.
+$(ndsdir)/arm9/source/blitters.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
$(ndsdir)/arm9/source/dsmain.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
$(ndsdir)/arm9/source/osystem_ds.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-$(ndsdir)/arm9/source/blitters.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-$(ndsdir)/arm9/source/ds_main.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/saga/isomap.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+base/main.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
sound/rate.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/saga/actor_walk.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+sound/softsynth/opl/mame.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/agi/sprite.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/agos/gfx.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/agos/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/cine/gfx.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/cruise/actor.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/cruise/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/draci/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/draci/sprite.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/gob/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/groovie/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/kyra/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/m4/actor.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/m4/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/m4/sprite.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/made/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
engines/saga/actor_path.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/saga/image.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-sound/fmopl.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/saga/actor_walk.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
engines/saga/actor.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/scumm/actor.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/m4/actor.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/scumm/gfx.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/cine/gfx.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/agos/gfx.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
engines/saga/gfx.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/saga/image.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/saga/isomap.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/saga/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
engines/saga/sprite.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/m4/sprite.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-engines/agi/sprite.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
-# TODO: Fingolfin says: optimizing staticres for size would
+engines/sci/engine/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/scumm/actor.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/scumm/gfx.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/scumm/script.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/sword2/sprite.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+engines/teenagent/actor.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
+# TODO: Fingolfin says: optimizing kyra/staticres.o for size would
# save about 30k, so maybe consider that?
#engines/kyra/staticres.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
diff --git a/backends/platform/ds/setup-builddirs.sh b/backends/platform/ds/setup-builddirs.sh
new file mode 100755
index 0000000000..11aacc1233
--- /dev/null
+++ b/backends/platform/ds/setup-builddirs.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# TODO: Allow specifying (a list of) build ids (a, b, ...) on the command line.
+# TODO: Allow overriding the LOGO variable
+
+# TODO: Computer srcdir in a better way
+srcdir=../../../`dirname $0`/..
+
+BASE_PARAM="--host=ds --disable-translation --disable-debug --disable-all-engines"
+
+for build in a b c d e f g h i k; do
+ echo "--- Setting up build $build ---"
+ mkdir -p build-$build && cd build-$build
+ case $build in
+ a)
+ EXTRA_PARAM="--enable-scumm"
+ ;;
+ b)
+ EXTRA_PARAM="--enable-sky --enable-queen"
+ ;;
+ c)
+ EXTRA_PARAM="--enable-agos"
+ ;;
+ d)
+ EXTRA_PARAM="--enable-gob --enable-cine --enable-agi"
+ ;;
+ e)
+ EXTRA_PARAM="--enable-saga --disable-mad"
+ ;;
+ f)
+ EXTRA_PARAM="--enable-kyra --disable-mad"
+ ;;
+ g)
+ EXTRA_PARAM="--enable-lure"
+ ;;
+ h)
+ EXTRA_PARAM="--enable-parallaction"
+ ;;
+ i)
+ EXTRA_PARAM="--enable-made --disable-mad"
+ ;;
+ k)
+ EXTRA_PARAM="--enable-cruise --disable-mad"
+ ;;
+ *)
+ echo "Invalid build $build selected"
+ exit 1
+ ;;
+ esac
+
+ defname="DS_BUILD_`echo $build | tr '[a-z]' '[A-Z]'`"
+ CPPFLAGS="$CPPFLAGS -D$defname"
+ $srcdir/configure $BASE_PARAM $EXTRA_PARAM
+ cd ..
+ echo DONE
+ echo
+done