aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--Makefile.mingw4
-rw-r--r--common/gameDetector.cpp8
-rw-r--r--common/gameDetector.h1
-rwxr-xr-xconfigure4
-rw-r--r--scumm.dsp8
-rw-r--r--scumm/object.cpp14
-rw-r--r--scumm/resource.cpp6
-rw-r--r--scumm/scumm.h1
-rw-r--r--scumm/scummvm.cpp27
-rw-r--r--scummvm.dsp6
-rw-r--r--simon.dsp6
12 files changed, 40 insertions, 49 deletions
diff --git a/Makefile b/Makefile
index a8125d3c67..73783df55d 100644
--- a/Makefile
+++ b/Makefile
@@ -31,10 +31,6 @@ OBJS :=
# Compile options - you can modify these to tweak ScummVM compilation #
#######################################################################
-# Enable this if you want ScummVM to dump all scripts it runs.
-# This is mainly interesting for developers.
-# DEFINES += -DDUMP_SCRIPTS
-
# Uncomment this to activate the MAD lib for compressed sound files
DEFINES += -DUSE_MAD
LIBS += -lmad
diff --git a/Makefile.mingw b/Makefile.mingw
index 11a074c6e6..ea3bf0c0c7 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -35,10 +35,6 @@ EXEEXT :=.exe
# Compile options - you can modify these to tweak ScummVM compilation #
#######################################################################
-# Enable this if you want ScummVM to dump all scripts it runs.
-# This is mainly interesting for developers.
-# DEFINES += -DDUMP_SCRIPTS
-
# Uncomment this to activate the MAD lib for compressed sound files
DEFINES += -DUSE_MAD
LIBS += -lmad
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index 802a94e648..2df831395e 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -71,6 +71,7 @@ static const char USAGE_STRING[] =
"\n"
"\t-b<num> - start in room <num>\n"
"\t-d[<num>] - enable debug output (debug level [1])\n"
+ "\t-u - dump scripts\n"
;
@@ -205,8 +206,9 @@ GameDetector::GameDetector()
_amiga = false;
_talkSpeed = 60;
- _debugLevel = 0;
_debugMode = 0;
+ _debugLevel = 0;
+ _dumpScripts = 0;
_noSubtitles = false;
_bootParam = 0;
@@ -427,6 +429,10 @@ void GameDetector::parseCommandLine(int argc, char **argv)
_gameTempo = strtol(option, 0, 0);
g_config->set("tempo", option);
break;
+ case 'u':
+ CHECK_OPTION();
+ _dumpScripts = true;
+ break;
case 'v':
CHECK_OPTION();
printf("ScummVM " SCUMMVM_VERSION "\nBuilt on " __DATE__ " "
diff --git a/common/gameDetector.h b/common/gameDetector.h
index 98f6b8e086..bcf423d795 100644
--- a/common/gameDetector.h
+++ b/common/gameDetector.h
@@ -136,6 +136,7 @@ public:
uint16 _talkSpeed;
uint16 _debugMode;
uint16 _debugLevel;
+ bool _dumpScripts;
bool _noSubtitles;
uint16 _bootParam;
diff --git a/configure b/configure
index d2f0288eed..05ab98d471 100755
--- a/configure
+++ b/configure
@@ -12,7 +12,6 @@
# * command line options to...
# - override the host settings (for cross compiles
# - select the desired backend (sdl, x11, ...)
-# - whether to dump scripts (sets -DDUMP_SCRIPTS)
# - whether mad should be used (--enabled-mad) -> set LIBS/DEFINES
# - whether to do a debug build (with -g) or an optimized build (-O3 etc.)
# * detect whether the chosen backend is available (e.g. call sdl-config)
@@ -109,9 +108,6 @@ for x in $@; do
echo "#define USE_MAD" >> config.h
LIBS="$LIBS -lmad"
;;
- x--enable-dump-scripts)
- echo "#define DUMP_SCRIPTS" >> config.h
- ;;
esac;
done;
diff --git a/scumm.dsp b/scumm.dsp
index e63714db16..87648d27d6 100644
--- a/scumm.dsp
+++ b/scumm.dsp
@@ -66,7 +66,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "scumm___Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /D "DUMP_SCRIPTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x415 /d "_DEBUG"
# ADD RSC /l 0x415 /d "_DEBUG"
BSC32=bscmake.exe
@@ -88,8 +88,8 @@ LIB32=link.exe -lib
# PROP Output_Dir "scumm___MP3_Enabled_Debug"
# PROP Intermediate_Dir "scumm___MP3_Enabled_Debug"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /D "DUMP_SCRIPTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /D "DUMP_SCRIPTS" /YX /FD /GZ /c
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /YX /FD /GZ /c
# ADD BASE RSC /l 0x415 /d "_DEBUG"
# ADD RSC /l 0x415 /d "_DEBUG"
BSC32=bscmake.exe
@@ -111,7 +111,7 @@ LIB32=link.exe -lib
# PROP Output_Dir "scumm___MP3_Enabled_Release"
# PROP Intermediate_Dir "scumm___MP3_Enabled_Release"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "DUMP_SCRIPTS" /YX /FD /c
+# ADD BASE CPP /nologo /W3 /GX /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /YX /FD /c
# ADD CPP /nologo /G6 /MD /W3 /WX /GX /Zi /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /YX /FD /c
# ADD BASE RSC /l 0x415 /d "NDEBUG"
# ADD RSC /l 0x415 /d "NDEBUG"
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 22b1b68155..43c28b0576 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -440,16 +440,15 @@ void Scumm::loadRoomObjects()
else
od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id));
-#ifdef DUMP_SCRIPTS
- do {
+ if (_dumpScripts) {
char buf[32];
sprintf(buf, "roomobj-%d-", _roomResource);
if (_features & GF_AFTER_V8)
// TODO - maybe V8 is not the only that needs this?
ptr = findResource(MKID('VERB'), ptr, 0);
dumpResource(buf, od->obj_nr, ptr);
- } while (0);
-#endif
+ }
+
searchptr = NULL;
}
@@ -514,13 +513,12 @@ void Scumm::loadRoomObjectsSmall()
od->OBCDoffset = ptr - room;
od->obj_nr = READ_LE_UINT16(ptr + 6);
-#ifdef DUMP_SCRIPTS
- do {
+ if (_dumpScripts) {
char buf[32];
sprintf(buf, "roomobj-%d-", _roomResource);
dumpResource(buf, od->obj_nr, ptr);
- } while (0);
-#endif
+ }
+
searchptr = NULL;
}
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index 5a07623173..9788207ff3 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -585,12 +585,10 @@ int Scumm::loadResource(int type, int idx)
}
_fileHandle.read(createResource(type, idx, size), size);
- /* dump the resource */
-#ifdef DUMP_SCRIPTS
- if (type == rtScript) {
+ // dump the resource if requested
+ if (_dumpScripts && type == rtScript) {
dumpResource("script-", idx, getResourceAddress(rtScript, idx));
}
-#endif
if (!_fileHandle.ioFailed()) {
return 1;
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 78b3e9c5c2..0a70e86e0b 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -377,6 +377,7 @@ public:
int16 _virtual_mouse_x, _virtual_mouse_y;
int _bootParam;
+ bool _dumpScripts;
uint16 _debugMode, _soundCardType;
/* Not sure where this stuff goes */
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 12292137f7..bf94018b06 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -85,6 +85,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
_debugMode = detector->_debugMode;
_debugLevel = detector->_debugLevel;
+ _dumpScripts = detector->_dumpScripts;
_bootParam = detector->_bootParam;
_exe_name = (char*)detector->_gameRealName.c_str();
_game_name = (char*)detector->_gameFileName.c_str();
@@ -755,18 +756,16 @@ void Scumm::initRoomSubBlocks()
ptr = findResourceData(MKID('EXCD'), roomResPtr);
if (ptr) {
_EXCD_offs = ptr - roomResPtr;
-#ifdef DUMP_SCRIPTS
- dumpResource("exit-", _roomResource, ptr - _resourceHeaderSize);
-#endif
+ if (_dumpScripts)
+ dumpResource("exit-", _roomResource, ptr - _resourceHeaderSize);
}
// Look for an entry script
ptr = findResourceData(MKID('ENCD'), roomResPtr);
if (ptr) {
_ENCD_offs = ptr - roomResPtr;
-#ifdef DUMP_SCRIPTS
- dumpResource("entry-", _roomResource, ptr - _resourceHeaderSize);
-#endif
+ if (_dumpScripts)
+ dumpResource("entry-", _roomResource, ptr - _resourceHeaderSize);
}
if (_features & GF_SMALL_HEADER) {
@@ -856,13 +855,13 @@ void Scumm::initRoomSubBlocks()
int id = 0;
ptr += _resourceHeaderSize; /* skip tag & size */
id = ptr[0];
-#ifdef DUMP_SCRIPTS
- do {
+
+ if (_dumpScripts) {
char buf[32];
sprintf(buf, "room-%d-", _roomResource);
dumpResource(buf, id, ptr - 6);
- } while (0);
-#endif
+ }
+
_localScriptList[id - _numGlobalScripts] = ptr + 1 - roomptr;
searchptr = NULL;
}
@@ -884,13 +883,13 @@ void Scumm::initRoomSubBlocks()
id = ptr[0];
_localScriptList[id - _numGlobalScripts] = ptr + 1 - roomResPtr;
}
-#ifdef DUMP_SCRIPTS
- do {
+
+ if (_dumpScripts) {
char buf[32];
sprintf(buf, "room-%d-", _roomResource);
dumpResource(buf, id, ptr - 8);
- } while (0);
-#endif
+ }
+
searchptr = NULL;
}
}
diff --git a/scummvm.dsp b/scummvm.dsp
index 3dbdcf29dc..19ec6f3153 100644
--- a/scummvm.dsp
+++ b/scummvm.dsp
@@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "sound" /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "ALLOW_GDI" /D "BYPASS_COPY_PROT" /D "DUMP_SCRIPTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "sound" /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "ALLOW_GDI" /D "BYPASS_COPY_PROT" /YX /FD /GZ /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x41d /d "_DEBUG"
# ADD RSC /l 0x41d /d "_DEBUG"
@@ -96,9 +96,9 @@ LINK32=link.exe
# PROP Intermediate_Dir "scummvm___MP3_Enabled_Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /I "./sound" /I "./" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "ALLOW_GDI" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /D "DUMP_SCRIPTS" /D "USE_MAD" /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /I "./sound" /I "./" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "ALLOW_GDI" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /D "USE_MAD" /Yu"stdafx.h" /FD /GZ /c
# SUBTRACT BASE CPP /Fr
-# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "sound" /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "ALLOW_GDI" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /D "DUMP_SCRIPTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "sound" /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "ALLOW_GDI" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /YX /FD /GZ /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x41d /d "_DEBUG"
# ADD RSC /l 0x41d /d "_DEBUG"
diff --git a/simon.dsp b/simon.dsp
index e811379ecc..720b404d67 100644
--- a/simon.dsp
+++ b/simon.dsp
@@ -66,7 +66,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "simon___Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /D "DUMP_SCRIPTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x415 /d "_DEBUG"
# ADD RSC /l 0x415 /d "_DEBUG"
BSC32=bscmake.exe
@@ -88,8 +88,8 @@ LIB32=link.exe -lib
# PROP Output_Dir "simon___MP3_Enabled_Debug"
# PROP Intermediate_Dir "simon___MP3_Enabled_Debug"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /D "DUMP_SCRIPTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /D "DUMP_SCRIPTS" /FD /GZ /c
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x415 /d "_DEBUG"
# ADD RSC /l 0x415 /d "_DEBUG"