get rid of DUMP_SCRIPTS; in its place, added run time option '-u' to enabled script dumping

svn-id: r6284
This commit is contained in:
Max Horn
2002-12-31 02:09:57 +00:00
parent 1ce31266a9
commit 166ea5bcee
12 changed files with 40 additions and 49 deletions
-4
View File
@@ -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
-4
View File
@@ -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
+7 -1
View File
@@ -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__ " "
+1
View File
@@ -136,6 +136,7 @@ public:
uint16 _talkSpeed;
uint16 _debugMode;
uint16 _debugLevel;
bool _dumpScripts;
bool _noSubtitles;
uint16 _bootParam;
Vendored
-4
View File
@@ -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;
+4 -4
View File
@@ -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"
+6 -8
View File
@@ -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;
}
+2 -4
View File
@@ -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;
+1
View File
@@ -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 */
+13 -14
View File
@@ -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;
}
}
+3 -3
View File
@@ -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"
+3 -3
View File
@@ -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"