Skip to content

Commit

Permalink
DS: Fix compilation with devkitARM r47
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 authored and sev- committed Apr 7, 2018
1 parent 668084c commit 9111998
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 21 deletions.
8 changes: 4 additions & 4 deletions audio/softsynth/opl/mame.cpp
Expand Up @@ -29,6 +29,10 @@
#include <stdarg.h>
#include <math.h>

#if defined(__DS__)
#include "dsmain.h"
#endif

#include "mame.h"

#include "audio/mixer.h"
Expand All @@ -40,10 +44,6 @@
#include "common/config-manager.h"
#endif

#if defined(__DS__)
#include "dsmain.h"
#endif

namespace OPL {
namespace MAME {

Expand Down
2 changes: 1 addition & 1 deletion backends/fs/ds/ds-fs-factory.cpp
Expand Up @@ -24,9 +24,9 @@
#define FORBIDDEN_SYMBOL_EXCEPTION_FILE

#if defined(__DS__)
#include "dsmain.h" //for the isGBAMPAvailable() function
#include "backends/fs/ds/ds-fs-factory.h"
#include "backends/fs/ds/ds-fs.h"
#include "dsmain.h" //for the isGBAMPAvailable() function

namespace Common {
DECLARE_SINGLETON(DSFilesystemFactory);
Expand Down
2 changes: 1 addition & 1 deletion backends/fs/ds/ds-fs.cpp
Expand Up @@ -23,12 +23,12 @@
// Disable symbol overrides for FILE as that is used in FLAC headers
#define FORBIDDEN_SYMBOL_EXCEPTION_FILE

#include "dsmain.h"
#include "common/str.h"
#include "common/util.h"
//#include <NDS/ARM9/console.h> //basic print funcionality
#include "backends/fs/ds/ds-fs.h"
#include "backends/fs/stdiostream.h"
#include "dsmain.h"
#include "fat/gba_nds_fat.h"
#include "common/bufferedstream.h"

Expand Down
2 changes: 1 addition & 1 deletion backends/platform/ds/arm9/source/cdaudio.cpp
Expand Up @@ -23,10 +23,10 @@
// Disable symbol overrides for FILE as that is used in FLAC headers
#define FORBIDDEN_SYMBOL_EXCEPTION_FILE

#include "dsmain.h"
#include "cdaudio.h"
#include "backends/fs/ds/ds-fs.h"
#include "common/config-manager.h"
#include "dsmain.h"
#include "NDS/scummvm_ipc.h"

#define WAV_FORMAT_IMA_ADPCM 0x14
Expand Down
2 changes: 1 addition & 1 deletion backends/platform/ds/arm9/source/dsmain.cpp
Expand Up @@ -573,7 +573,7 @@ void initGame() {
s_currentGame = &gameList[0]; // Default game

for (int r = 0; r < NUM_SUPPORTED_GAMES; r++) {
if (!stricmp(gameName, gameList[r].gameId)) {
if (!scumm_stricmp(gameName, gameList[r].gameId)) {
s_currentGame = &gameList[r];
// consolePrintf("Game list num: %d\n", r);
}
Expand Down
2 changes: 2 additions & 0 deletions backends/platform/ds/arm9/source/dsmain.h
Expand Up @@ -23,6 +23,8 @@
#ifndef _DSMAIN_H
#define _DSMAIN_H

#define FORBIDDEN_SYMBOL_ALLOW_ALL

#include <nds.h>
#include "osystem_ds.h"

Expand Down
2 changes: 1 addition & 1 deletion backends/platform/ds/arm9/source/dsoptions.cpp
Expand Up @@ -20,8 +20,8 @@
*
*/

#include "dsoptions.h"
#include "dsmain.h"
#include "dsoptions.h"
#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/widgets/list.h"
Expand Down
2 changes: 1 addition & 1 deletion backends/platform/ds/arm9/source/fat/disc_io.c
Expand Up @@ -367,7 +367,7 @@ bool disc_setDsSlotInterface (void)

active_interface = DLDI_GetInterface();

if (stricmp((char *)(&_dldi_driver_name), "Default (No interface)")) {
if (strcasecmp((char *)(&_dldi_driver_name), "Default (No interface)")) {
char name[48];
memcpy(name, &_dldi_driver_name, 48);
name[47] = '\0';
Expand Down
1 change: 1 addition & 0 deletions backends/platform/ds/arm9/source/osystem_ds.cpp
Expand Up @@ -23,6 +23,7 @@

// Allow use of stuff in <time.h>
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
#define FORBIDDEN_SYMBOL_ALLOW_ALL

#include "common/scummsys.h"
#include "common/system.h"
Expand Down
2 changes: 2 additions & 0 deletions backends/platform/ds/arm9/source/osystem_ds.h
Expand Up @@ -24,6 +24,8 @@
#ifndef _OSYSTEM_DS_H_
#define _OSYSTEM_DS_H_

#define FORBIDDEN_SYMBOL_ALLOW_ALL

#include "backends/base-backend.h"
#include "common/events.h"
#include "nds.h"
Expand Down
2 changes: 1 addition & 1 deletion backends/platform/ds/arm9/source/wordcompletion.cpp
Expand Up @@ -20,8 +20,8 @@
*
*/

#include "wordcompletion.h"
#include "osystem_ds.h"
#include "wordcompletion.h"
#include "engines/agi/agi.h" // Caution for #define for NUM_CHANNELS, causes problems in mixer_intern.h

#ifdef ENABLE_AGI
Expand Down
3 changes: 2 additions & 1 deletion backends/platform/ds/arm9/source/zipreader.cpp
Expand Up @@ -23,6 +23,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL

#include "common/scummsys.h"
#include "common/str.h"
#include "zipreader.h"

ZipFile::ZipFile() {
Expand Down Expand Up @@ -193,7 +194,7 @@ bool ZipFile::findFile(const char *search) {
}


if (!stricmp(name, searchName)) {
if (!scumm_stricmp(name, searchName)) {
// consolePrintf("'%s'=='%s'\n", name, searchName);
return true; // Got it!
} else {
Expand Down
11 changes: 6 additions & 5 deletions backends/platform/ds/ds.mk
Expand Up @@ -75,7 +75,7 @@ endif


# Compiler options for files which should be optimised for speed
OPT_SPEED := -O3 -mno-thumb
OPT_SPEED := -O3 -marm

# Compiler options for files which should be optimised for space
OPT_SIZE := -Os -mthumb
Expand Down Expand Up @@ -134,7 +134,8 @@ engines/teenagent/actor.o: CXXFLAGS:=$(CXXFLAGS) $(OPT_SPEED)
#
#############################################################################

all: scummvm.nds scummvm.ds.gba
# FIXME: Newer versions of devkitARM don't include dsbuild, which is needed to create scummvm.ds.gba
all: scummvm.nds # scummvm.ds.gba

clean: dsclean

Expand Down Expand Up @@ -170,10 +171,10 @@ dsclean:

# HACK/FIXME: C compiler, for cartreset.c -- we should switch this to use CXX
# as soon as possible.
CC := $(DEVKITPRO)/devkitARM/bin/arm-eabi-gcc
CC := $(DEVKITPRO)/devkitARM/bin/arm-none-eabi-gcc

# HACK/TODO: Pointer to objcopy. This should really be set by configure
OBJCOPY := $(DEVKITPRO)/devkitARM/bin/arm-eabi-objcopy
OBJCOPY := $(DEVKITPRO)/devkitARM/bin/arm-none-eabi-objcopy

#
# Set various flags
Expand All @@ -194,7 +195,7 @@ ARM7_CFLAGS := -g -Wall -O2\

ARM7_CXXFLAGS := $(ARM7_CFLAGS) -fno-exceptions -fno-rtti

ARM7_LDFLAGS := -g $(ARM7_ARCH) -mno-fpu
ARM7_LDFLAGS := -g $(ARM7_ARCH) -mfloat-abi=soft

# HACK/FIXME: Define a custom build rule for cartreset.c.
# We do this because it is a .c file, not a .cpp file and so is outside our
Expand Down
2 changes: 2 additions & 0 deletions backends/plugins/ds/ds-provider.cpp
Expand Up @@ -20,6 +20,8 @@
*
*/

#define FORBIDDEN_SYMBOL_ALLOW_ALL

#include "common/scummsys.h"

#if defined(DYNAMIC_MODULES) && defined(__DS__)
Expand Down
13 changes: 9 additions & 4 deletions configure
Expand Up @@ -1476,7 +1476,7 @@ dreamcast)
ds)
_host_os=ds
_host_cpu=arm
_host_alias=arm-eabi
_host_alias=arm-none-eabi
;;
gamecube)
_host_os=gamecube
Expand Down Expand Up @@ -2555,7 +2555,8 @@ case $_host_os in
append_var DEFINES "-DARM"
append_var DEFINES "-DNONSTANDARD_PORT"
append_var CXXFLAGS "-isystem $DEVKITPRO/libnds/include"
append_var CXXFLAGS "-isystem $DEVKITPRO/devkitARM/arm-eabi/include"
append_var CXXFLAGS "-I$DEVKITPRO/portlibs/nds/include"
append_var CXXFLAGS "-I$DEVKITPRO/portlibs/armv5te/include"
append_var CXXFLAGS "-mcpu=arm9tdmi"
append_var CXXFLAGS "-mtune=arm9tdmi"
append_var CXXFLAGS "-fomit-frame-pointer"
Expand All @@ -2566,7 +2567,7 @@ case $_host_os in
append_var CXXFLAGS "-fuse-cxa-atexit"
append_var LDFLAGS "-specs=ds_arm9.specs"
append_var LDFLAGS "-mthumb-interwork"
append_var LDFLAGS "-mno-fpu"
append_var LDFLAGS "-mfloat-abi=soft"
append_var LDFLAGS "-Wl,-Map,map.txt"
if test "$_dynamic_modules" = no ; then
append_var LDFLAGS "-Wl,--gc-sections"
Expand All @@ -2576,6 +2577,8 @@ case $_host_os in
# append_var LDFLAGS "-Wl,--retain-symbols-file,ds.syms"
fi
append_var LDFLAGS "-L$DEVKITPRO/libnds/lib"
append_var LDFLAGS "-L$DEVKITPRO/portlibs/nds/lib"
append_var LDFLAGS "-L$DEVKITPRO/portlibs/armv5te/lib"
append_var LIBS "-lnds9"
;;
freebsd*)
Expand Down Expand Up @@ -3727,7 +3730,7 @@ POST_OBJS_FLAGS := -Wl,--no-whole-archive
append_var DEFINES "-DUNCACHED_PLUGINS"
append_var DEFINES "-DELF_NO_MEM_MANAGER"
_mak_plugins='
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/ds/plugin.ld -mthumb-interwork -mno-fpu
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/ds/plugin.ld -mthumb-interwork -mfloat-abi=soft
'
;;
freebsd*)
Expand Down Expand Up @@ -5232,6 +5235,7 @@ cat > config.h << EOF
$_config_h_data
/* Data types */
#ifndef SCUMMVM_DONT_DEFINE_TYPES
typedef unsigned $type_1_byte byte;
typedef unsigned int uint;
typedef unsigned $type_1_byte uint8;
Expand All @@ -5242,6 +5246,7 @@ typedef signed $type_1_byte int8;
typedef signed $type_2_byte int16;
typedef signed $type_4_byte int32;
typedef signed $type_8_byte int64;
#endif
typedef $type_ptr uintptr;
Expand Down

0 comments on commit 9111998

Please sign in to comment.