[Scummvm-cvs-logs] SF.net SVN: scummvm:[54952] tools/branches/gsoc2010-decompiler
pidgeot at users.sourceforge.net
pidgeot at users.sourceforge.net
Sat Dec 18 13:49:08 CET 2010
Revision: 54952
http://scummvm.svn.sourceforge.net/scummvm/?rev=54952&view=rev
Author: pidgeot
Date: 2010-12-18 12:49:08 +0000 (Sat, 18 Dec 2010)
Log Message:
-----------
DECOMPILER: Merge trunk changes into branch
Modified Paths:
--------------
tools/branches/gsoc2010-decompiler/Makefile.common
tools/branches/gsoc2010-decompiler/NEWS
tools/branches/gsoc2010-decompiler/README
tools/branches/gsoc2010-decompiler/configure
tools/branches/gsoc2010-decompiler/engines/gob/degob.cpp
tools/branches/gsoc2010-decompiler/engines/gob/degob_script.h
tools/branches/gsoc2010-decompiler/engines/gob/degob_script_fascin.cpp
tools/branches/gsoc2010-decompiler/engines/gob/degob_script_v1.cpp
tools/branches/gsoc2010-decompiler/engines/kyra/compress_kyra.cpp
tools/branches/gsoc2010-decompiler/engines/mohawk/archive.cpp
tools/branches/gsoc2010-decompiler/engines/mohawk/archive.h
tools/branches/gsoc2010-decompiler/engines/sci/compress_sci.cpp
tools/branches/gsoc2010-decompiler/engines/scumm/descumm-common.cpp
tools/branches/gsoc2010-decompiler/engines/scumm/descumm.cpp
tools/branches/gsoc2010-decompiler/engines/scumm/descumm.h
tools/branches/gsoc2010-decompiler/engines/scumm/descumm6.cpp
tools/branches/gsoc2010-decompiler/gui/pages.cpp
tools/branches/gsoc2010-decompiler/tools.cpp
Added Paths:
-----------
tools/branches/gsoc2010-decompiler/engines/gob/degob_script_geisha.cpp
tools/branches/gsoc2010-decompiler/engines/gob/extract_fascination_cd.cpp
tools/branches/gsoc2010-decompiler/engines/gob/extract_fascination_cd.h
Property Changed:
----------------
tools/branches/gsoc2010-decompiler/
Property changes on: tools/branches/gsoc2010-decompiler
___________________________________________________________________
Modified: svn:mergeinfo
- /tools/trunk:41370-43135,48931-51928,52059-52127
+ /tools/trunk:41370-43135,48926-54951
Modified: tools/branches/gsoc2010-decompiler/Makefile.common
===================================================================
--- tools/branches/gsoc2010-decompiler/Makefile.common 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/Makefile.common 2010-12-18 12:49:08 UTC (rev 54952)
@@ -134,6 +134,22 @@
version.o \
$(UTILS)
+degob_OBJS := \
+ engines/gob/degob.o \
+ engines/gob/degob_script.o \
+ engines/gob/degob_script_v1.o \
+ engines/gob/degob_script_v2.o \
+ engines/gob/degob_script_v3.o \
+ engines/gob/degob_script_v4.o \
+ engines/gob/degob_script_v5.o \
+ engines/gob/degob_script_v6.o \
+ engines/gob/degob_script_bargon.o \
+ engines/gob/degob_script_fascin.o \
+ engines/gob/degob_script_geisha.o \
+ tool.o \
+ version.o \
+ $(UTILS)
+
gob_loadcalc_OBJS := \
engines/gob/gob_loadcalc.o
@@ -166,6 +182,7 @@
tools_OBJS := \
engines/agos/compress_agos.o \
engines/gob/compress_gob.o \
+ engines/gob/extract_fascination_cd.o \
engines/kyra/compress_kyra.o \
engines/queen/compress_queen.o \
engines/saga/compress_saga.o \
Modified: tools/branches/gsoc2010-decompiler/NEWS
===================================================================
--- tools/branches/gsoc2010-decompiler/NEWS 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/NEWS 2010-12-18 12:49:08 UTC (rev 54952)
@@ -2,6 +2,8 @@
http://scummvm.svn.sourceforge.net/viewvc/scummvm/tools/trunk/?view=log
1.2.0 (????-??-??)
+ - Add extract_fascination_cd tool for extracting STK archives from a mode1/2048
+ Fascination CD image.
- Fix bug #2984225: "Tools: configure should check if libwxgtk2.8-dev is installed".
- Add version information to tools.
- Respect $BINDIR when installing (similar to ScummVM).
Modified: tools/branches/gsoc2010-decompiler/README
===================================================================
--- tools/branches/gsoc2010-decompiler/README 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/README 2010-12-18 12:49:08 UTC (rev 54952)
@@ -275,10 +275,10 @@
required to play the game under ScummVM.
Example of usage:
- ./scummvm-tools-cli --tool compress_touche [mode params] [-o outputfile] <infile>
+ ./scummvm-tools-cli --tool compress_touche [mode params] [-o outputfile] <inputdir>
- Default outpufile is infile with modified extension (depends
- on compression method).
+ Default outpufile is TOUCHE.* (depends on compression method).
+ Files in the input folder should be in uppercase.
compress_tucker
Used to compress .wav files from FX/MUSIC/SPEECH directories
Modified: tools/branches/gsoc2010-decompiler/configure
===================================================================
--- tools/branches/gsoc2010-decompiler/configure 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/configure 2010-12-18 12:49:08 UTC (rev 54952)
@@ -873,11 +873,13 @@
#
# Check for FLAC
#
-echocheck "FLAC >= 1.0.1"
+echocheck "FLAC >= 1.1.3"
if test "$_flac" = auto ; then
_flac=no
cat > $TMPC << EOF
#include <FLAC/format.h>
+#include <FLAC/stream_encoder.h>
+FLAC__StreamEncoderInitStatus x;
int main(void) { return FLAC__STREAM_SYNC_LEN >> 30; /* guaranteed to be 0 */ }
EOF
if test "$_vorbis" = yes ; then
Modified: tools/branches/gsoc2010-decompiler/engines/gob/degob.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/gob/degob.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/gob/degob.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -123,6 +123,7 @@
printf(" Woodruff - The Bizarre Adventures of Woodruff and the Schnibble\n");
printf(" Dynasty - The Last Dynasty\n");
printf(" Urban - Urban Runner\n");
+ printf(" Geisha - Geisha\n");
}
int getVersion(const char *verStr) {
@@ -146,6 +147,8 @@
return 8;
else if (!scumm_stricmp(verStr, "Urban"))
return 9;
+ else if (!scumm_stricmp(verStr, "Geisha"))
+ return 10;
return -1;
}
@@ -193,6 +196,9 @@
case 9:
return new Script_v6(totData, totSize, extTable);
break;
+ case 10:
+ return new Script_Geisha(totData, totSize, extTable);
+ break;
}
return 0;
}
Modified: tools/branches/gsoc2010-decompiler/engines/gob/degob_script.h
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/gob/degob_script.h 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/gob/degob_script.h 2010-12-18 12:49:08 UTC (rev 54952)
@@ -307,6 +307,44 @@
void o2_handleGoblins(FuncParams ¶ms);
};
+class Script_Geisha : public Script_v1 {
+public:
+ Script_Geisha(byte *totData, uint32 totSize, ExtTable *extTable = 0);
+ virtual ~Script_Geisha();
+
+protected:
+ typedef void (Script_Geisha::*OpcodeDrawProcGeisha)(FuncParams &);
+ typedef void (Script_Geisha::*OpcodeFuncProcGeisha)(FuncParams &);
+ typedef void (Script_Geisha::*OpcodeGoblinProcGeisha)(FuncParams &);
+ struct OpcodeDrawEntryGeisha {
+ FuncType type;
+ OpcodeDrawProcGeisha proc;
+ const char *desc;
+ const Param params[16];
+ };
+ struct OpcodeFuncEntryGeisha {
+ FuncType type;
+ OpcodeFuncProcGeisha proc;
+ const char *desc;
+ const Param params[16];
+ };
+ struct OpcodeGoblinEntryGeisha {
+ FuncType type;
+ OpcodeGoblinProcGeisha proc;
+ const char *desc;
+ const Param params[16];
+ };
+ const OpcodeDrawEntryGeisha *_opcodesDrawGeisha;
+ const OpcodeFuncEntryGeisha *_opcodesFuncGeisha;
+ const OpcodeGoblinEntryGeisha *_opcodesGoblinGeisha;
+ static const int _goblinFuncLookUp[][2];
+
+ virtual void setupOpcodes();
+ virtual void drawOpcode(byte i, FuncParams ¶ms);
+ virtual void funcOpcode(byte i, byte j, FuncParams ¶ms);
+ virtual void goblinOpcode(int i, FuncParams ¶ms);
+};
+
class Script_Bargon : public Script_v2 {
public:
Script_Bargon(byte *totData, uint32 totSize, ExtTable *extTable = 0);
Modified: tools/branches/gsoc2010-decompiler/engines/gob/degob_script_fascin.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/gob/degob_script_fascin.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/gob/degob_script_fascin.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -392,7 +392,7 @@
{OPCODEF(o1_whileDo), {PARAM_NONE}},
/* 08 */
{OPCODEF(o1_if), {PARAM_NONE}},
- {OPCODEF(o1_assign), {PARAM_NONE}},
+ {OPCODEF(o2_assign), {PARAM_NONE}},
{OPCODEF(o1_loadSpriteToPos), {PARAM_NONE}},
{TYPE_NONE, 0, 0, {PARAM_NONE}},
/* 0C */
Copied: tools/branches/gsoc2010-decompiler/engines/gob/degob_script_geisha.cpp (from rev 54951, tools/trunk/engines/gob/degob_script_geisha.cpp)
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/gob/degob_script_geisha.cpp (rev 0)
+++ tools/branches/gsoc2010-decompiler/engines/gob/degob_script_geisha.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -0,0 +1,621 @@
+/* DeGob - GobEngine Script disassembler
+ * Copyright (C) 2008 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "degob_script.h"
+#include "common/endian.h"
+#include "common/util.h"
+
+#define OPCODET(x) _OPCODET(Script_Geisha, x)
+#define OPCODEF(x) _OPCODEF(Script_Geisha, x)
+#define OPCODEB(x) _OPCODEB(Script_Geisha, x)
+
+const int Script_Geisha::_goblinFuncLookUp[][2] = {
+ {1, 0},
+ {2, 1},
+ {3, 2},
+ {4, 3},
+ {5, 4},
+ {6, 5},
+ {7, 6},
+ {8, 7},
+ {9, 8},
+ {10, 9},
+ {12, 10},
+ {13, 11},
+ {14, 12},
+ {15, 13},
+ {16, 14},
+ {21, 15},
+ {22, 16},
+ {23, 17},
+ {24, 18},
+ {25, 19},
+ {26, 20},
+ {27, 21},
+ {28, 22},
+ {29, 23},
+ {30, 24},
+ {32, 25},
+ {33, 26},
+ {34, 27},
+ {35, 28},
+ {36, 29},
+ {37, 30},
+ {40, 31},
+ {41, 32},
+ {42, 33},
+ {43, 34},
+ {44, 35},
+ {50, 36},
+ {52, 37},
+ {53, 38},
+ {150, 39},
+ {152, 40},
+ {200, 41},
+ {201, 42},
+ {202, 43},
+ {203, 44},
+ {204, 45},
+ {250, 46},
+ {251, 47},
+ {252, 48},
+ {500, 49},
+ {502, 50},
+ {503, 51},
+ {600, 52},
+ {601, 53},
+ {602, 54},
+ {603, 55},
+ {604, 56},
+ {605, 57},
+ {1000, 58},
+ {1001, 59},
+ {1002, 60},
+ {1003, 61},
+ {1004, 62},
+ {1005, 63},
+ {1006, 64},
+ {1008, 65},
+ {1009, 66},
+ {1010, 67},
+ {1011, 68},
+ {1015, 69},
+ {2005, 70},
+ {39, 71}
+};
+
+Script_Geisha::Script_Geisha(byte *totData, uint32 totSize, ExtTable *extTable) :
+ Script_v1(totData, totSize, extTable) {
+
+ setupOpcodes();
+}
+
+Script_Geisha::~Script_Geisha() {
+}
+
+void Script_Geisha::setupOpcodes() {
+ static const OpcodeDrawEntryGeisha opcodesDraw[256] = {
+ /* 00 */
+ {OPCODEF(o1_loadMult), {PARAM_NONE}},
+ {OPCODET(o1_playMult), {PARAM_UINT16}},
+ {OPCODET(o1_freeMultKeys), {PARAM_UINT16}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 04 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {OPCODET(o1_initCursor), {PARAM_VARINDEX, PARAM_VARINDEX, PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+ /* 08 */
+ {OPCODET(o1_initCursorAnim), {PARAM_EXPR, PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+ {OPCODET(o1_clearCursorAnim), {PARAM_EXPR}},
+ {OPCODET(o1_setRenderFlags), {PARAM_EXPR}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 0C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 10 */
+ {OPCODEF(o1_loadAnim), {PARAM_NONE}},
+ {OPCODET(o1_freeAnim), {PARAM_EXPR}},
+ {OPCODET(o1_updateAnim), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_UINT16}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 14 */
+ {OPCODET(o1_initMult), {PARAM_INT16, PARAM_INT16, PARAM_INT16, PARAM_INT16, PARAM_INT16, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX}},
+ {OPCODET(o1_freeMult), {PARAM_NONE}},
+ {OPCODET(o1_animate), {PARAM_NONE}},
+ {OPCODEF(o1_loadMultObject), {PARAM_NONE}},
+ /* 18 */
+ {OPCODET(o1_getAnimLayerInfo), {PARAM_EXPR, PARAM_EXPR, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX}},
+ {OPCODET(o1_getObjAnimSize), {PARAM_EXPR, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX}},
+ {OPCODEF(o1_loadStatic), {PARAM_NONE}},
+ {OPCODET(o1_freeStatic), {PARAM_EXPR}},
+ /* 1C */
+ {OPCODET(o1_renderStatic), {PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_loadCurLayer), {PARAM_EXPR, PARAM_EXPR}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 20 */
+ {OPCODET(o1_playCDTrack), {PARAM_EXPR}},
+ {OPCODET(o1_getCDTrackPos), {PARAM_NONE}},
+ {OPCODET(o1_stopCD), {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 24 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 28 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 2C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 30 */
+ {OPCODET(o1_loadFontToSprite), {PARAM_INT16, PARAM_INT16, PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+ {OPCODET(o1_freeFontToSprite), {PARAM_INT16}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 34 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 38 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 3C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 40 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 44 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 48 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 4C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 50 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 54 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 58 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 5C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 60 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 64 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 68 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 6C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 70 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 74 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 78 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 7C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 80 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 84 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 88 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 8C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 90 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 94 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 98 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 9C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* A0 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* A4 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* A8 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* AC */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* B0 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* B4 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* B8 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* BC */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* C0 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* C4 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* C8 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* CC */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* D0 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* D4 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* D8 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* DC */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* E0 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* E4 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* E8 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* EC */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* F0 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* F4 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* F8 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* FC */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ };
+
+ static const OpcodeFuncEntryGeisha opcodesFunc[80] = {
+ /* 00 */
+ {OPCODEF(o1_callSub), {PARAM_NONE}},
+ {OPCODEF(o1_callSub), {PARAM_NONE}},
+ {OPCODET(o1_printTotText), {PARAM_INT16}},
+ {OPCODET(o1_loadCursor), {PARAM_INT16, PARAM_INT8}},
+ /* 04 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {OPCODEF(o1_switch), {PARAM_NONE}},
+ {OPCODEF(o1_repeatUntil), {PARAM_NONE}},
+ {OPCODEF(o1_whileDo), {PARAM_NONE}},
+ /* 08 */
+ {OPCODEF(o1_if), {PARAM_NONE}},
+ {OPCODEF(o1_assign), {PARAM_NONE}},
+ {OPCODEF(o1_loadSpriteToPos), {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 0C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 10 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {OPCODEF(o1_printText), {PARAM_NONE}},
+ {OPCODEF(o1_loadTot), {PARAM_NONE}},
+ {OPCODEF(o1_palLoad), {PARAM_NONE}},
+ /* 14 */
+ {OPCODET(o1_keyFunc), {PARAM_INT16}},
+ {OPCODET(o1_capturePush), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_capturePop), {PARAM_NONE}},
+ {OPCODET(o1_animPalInit), {PARAM_INT16, PARAM_EXPR, PARAM_EXPR}},
+ /* 18 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 1C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {OPCODEF(o1_drawOperations), {PARAM_NONE}},
+ {OPCODEF(o1_setcmdCount), {PARAM_NONE}},
+ /* 20 */
+ {OPCODEF(o1_return), {PARAM_NONE}},
+ {OPCODET(o1_renewTimeInVars), {PARAM_NONE}},
+ {OPCODET(o1_speakerOn), {PARAM_EXPR}},
+ {OPCODET(o1_speakerOff), {PARAM_NONE}},
+ /* 24 */
+ {OPCODET(o1_putPixel), {PARAM_INT16, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+ {OPCODEF(o1_goblinFunc), {PARAM_NONE}},
+ {OPCODET(o1_createSprite), {PARAM_INT16, PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+ {OPCODET(o1_freeSprite), {PARAM_INT16}},
+ /* 28 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 2C */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ /* 30 */
+ {OPCODEF(o1_returnTo), {PARAM_NONE}},
+ {OPCODET(o1_loadSpriteContent), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+ {OPCODET(o1_copySprite), {PARAM_INT16, PARAM_INT16, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_INT16}},
+ {OPCODET(o1_fillRect), {PARAM_INT16, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+ /* 34 */
+ {OPCODET(o1_drawLine), {PARAM_INT16, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_strToLong), {PARAM_VARINDEX, PARAM_VARINDEX}},
+ {OPCODET(o1_invalidate), {PARAM_INT16, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_setBackDelta), {PARAM_EXPR, PARAM_EXPR}},
+ /* 38 */
+ {OPCODET(o1_playSound), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_stopSound), {PARAM_EXPR}},
+ {OPCODET(oGeisha_loadSound), {PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_freeSoundSlot), {PARAM_EXPR}},
+ /* 3C */
+ {OPCODET(o1_waitEndPlay), {PARAM_NONE}},
+ {OPCODET(o1_playComposition), {PARAM_VARINDEX, PARAM_EXPR}},
+ {OPCODET(o1_getFreeMem), {PARAM_VARINDEX, PARAM_VARINDEX}},
+ {OPCODET(o1_checkData), {PARAM_EXPR, PARAM_VARINDEX}},
+ /* 40 */
+ {TYPE_NONE, 0, 0, {PARAM_NONE}},
+ {OPCODET(o1_cleanupStr), {PARAM_VARINDEX}},
+ {OPCODET(o1_insertStr), {PARAM_VARINDEX, PARAM_EXPR}},
+ {OPCODET(o1_cutStr), {PARAM_VARINDEX, PARAM_EXPR, PARAM_EXPR}},
+ /* 44 */
+ {OPCODET(o1_strstr), {PARAM_VARINDEX, PARAM_EXPR, PARAM_VARINDEX}},
+ {OPCODET(o1_istrlen), {PARAM_VARINDEX, PARAM_VARINDEX}},
+ {OPCODET(o1_setMousePos), {PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_setFrameRate), {PARAM_EXPR}},
+ /* 48 */
+ {OPCODET(o1_animatePalette), {PARAM_NONE}},
+ {OPCODET(o1_animateCursor), {PARAM_NONE}},
+ {OPCODET(o1_blitCursor), {PARAM_NONE}},
+ {OPCODET(o1_loadFont), {PARAM_EXPR, PARAM_INT16}},
+ /* 4C */
+ {OPCODET(o1_freeFont), {PARAM_INT16}},
+ {OPCODET(o1_readData), {PARAM_EXPR, PARAM_VARINDEX, PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_writeData), {PARAM_EXPR, PARAM_VARINDEX, PARAM_EXPR, PARAM_EXPR}},
+ {OPCODET(o1_manageDataFile), {PARAM_EXPR}},
+ };
+
+ static const OpcodeGoblinEntryGeisha opcodesGoblin[8] = {
+ /* 00 */
+ {OPCODET(oGeisha_OG_0), {PARAM_INT16, PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+ {OPCODET(oGeisha_OG_1), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+ {OPCODET(oGeisha_loadGeisha), {PARAM_GOB}},
+ {OPCODET(oGeisha_adlibPlay), {PARAM_GOB}},
+ /* 04 */
+ {OPCODET(oGeisha_adlibStop), {PARAM_GOB}},
+ {OPCODET(oGeisha_OG_NOP), {PARAM_GOB}},
+ {OPCODET(oGeisha_OG_6), {PARAM_GOB}},
+ {OPCODET(oGeisha_OG_7), {PARAM_GOB}},
+ };
+
+ _opcodesDrawGeisha = opcodesDraw;
+ _opcodesFuncGeisha = opcodesFunc;
+ _opcodesGoblinGeisha = opcodesGoblin;
+}
+
+void Script_Geisha::drawOpcode(byte i, FuncParams ¶ms) {
+ FuncType type = _opcodesDrawGeisha[i].type;
+ params.desc = _opcodesDrawGeisha[i].desc;
+ OpcodeDrawProcGeisha op = _opcodesDrawGeisha[i].proc;
+
+ if (type == TYPE_NONE)
+ error("No such opcodeDraw: %d", i);
+ if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC))
+ printFuncDesc(params, _opcodesDrawGeisha[i].params);
+ if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+ (this->*op)(params);
+}
+
+void Script_Geisha::funcOpcode(byte i, byte j, FuncParams ¶ms) {
+ int n = i*16 + j;
+ FuncType type = TYPE_NONE;
+ OpcodeFuncProcGeisha op = 0;
+
+ if ((i <= 4) && (j <= 15)) {
+ op = _opcodesFuncGeisha[n].proc;
+ params.desc = _opcodesFuncGeisha[n].desc;
+ type = _opcodesFuncGeisha[n].type;
+ }
+
+ if (type == TYPE_NONE)
+ error("No such opcodeFunc: %d.%d", i, j);
+ if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC))
+ printFuncDesc(params, _opcodesFuncGeisha[n].params);
+ if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+ (this->*op)(params);
+}
+
+void Script_Geisha::goblinOpcode(int i, FuncParams ¶ms) {
+ int n = -1;
+ for (int j = 0; j < ARRAYSIZE(_goblinFuncLookUp); j++)
+ if (_goblinFuncLookUp[j][0] == i) {
+ n = _goblinFuncLookUp[j][1];
+ break;
+ }
+
+ FuncType type = TYPE_NONE;
+ OpcodeGoblinProcGeisha op = 0;
+
+ if (n >= 0) {
+ op = _opcodesGoblinGeisha[n].proc;
+ params.desc = _opcodesGoblinGeisha[n].desc;
+ type = _opcodesGoblinGeisha[n].type;
+ }
+
+ if (type == TYPE_NONE)
+ error("No such opcodeGoblin: %d (%d)", i, n);
+ if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC)) {
+ const Param *param = _opcodesGoblinGeisha[n].params;
+ if (*param == PARAM_GOB)
+ printFuncDesc(params);
+ else
+ printFuncDesc(params, param);
+ }
+ if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+ (this->*op)(params);
+}
+
Modified: tools/branches/gsoc2010-decompiler/engines/gob/degob_script_v1.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/gob/degob_script_v1.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/gob/degob_script_v1.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -753,7 +753,7 @@
if (offset >= 128)
addFuncOffset(offset);
} else if (peekUint8() == 2)
- print("o1_collisionsBlock(%d);\n", offset);
+ print("_hotspots->evaluate()(%d);\n", offset);
else
print("<Unknown block type %d (%d)>\n", peekUint8(), offset);
Copied: tools/branches/gsoc2010-decompiler/engines/gob/extract_fascination_cd.cpp (from rev 54951, tools/trunk/engines/gob/extract_fascination_cd.cpp)
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/gob/extract_fascination_cd.cpp (rev 0)
+++ tools/branches/gsoc2010-decompiler/engines/gob/extract_fascination_cd.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -0,0 +1,133 @@
+/* extract_fascination_cd - a tool for extracting .stk archives from a mode1/2048 Fascination CD image
+ * Copyright (C) 2010 The ScummVM Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: $
+ * $Id: $
+ *
+ */
+
+#include "common/endian.h"
+#include "common/file.h"
+#include "common/util.h"
+
+#include "extract_fascination_cd.h"
+
+
+enum {
+ STK_HEADER_ENTRY_SIZE = 22
+};
+
+struct STKFile {
+ const char *stkFilename;
+ const char *firstEntryName;
+ bool extracted;
+} static stkFile[] = {
+ { "intro.stk", "INTRO1.TOT", false },
+ { "disk1.stk", "DOUCHE.TOT", false },
+ { "disk2.stk", "PLANQUE.TOT", false },
+ { "disk3.stk", "MELANGE.TOT", false },
+};
+
+
+ExtractFascinationCD::ExtractFascinationCD(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
+ ToolInput input;
+ input.format = "*.iso";
+ _inputPaths.push_back(input);
+
+ _shorthelp = "Extract data files from a Fascination ISO.";
+ _helptext = "Usage: " + _name + " [-o outputdir] <infile>\n" + _shorthelp + "\n";
+}
+
+void ExtractFascinationCD::execute(void) {
+ if (_outputPath.empty())
+ _outputPath.setFullPath("./");
+
+ // Open ISO file
+ Common::File file(_inputPaths[0].path, "rb");
+ assert(file.isOpen());
+ uint32 fileSize = file.size();
+
+ // Sanity check the file size
+ if (fileSize > (16 * 1024 * 1024)) {
+ error("'%s' is too large to be a Fascination mode1/2048 ISO", _inputPaths[0].path.c_str());
+ }
+
+ if (fileSize < (8 * 1024 * 1024)) {
+ error("'%s' is too small to be a Fascination mode1/2048 ISO", _inputPaths[0].path.c_str());
+ }
+
+ if (fileSize % 2048) {
+ error("'%s' doesn't appear to be a mode1/2048 ISO", _inputPaths[0].path.c_str());
+ }
+
+ // Load ISO file to memory. (Should only be ~10MB, and this simplifies the code)
+ byte *data = new byte[fileSize];
+ file.read_noThrow(data, fileSize);
+ file.close();
+
+ print("Loaded '%s' (%d bytes)\n", _inputPaths[0].path.c_str(), fileSize);
+
+ for (uint32 i = 0; i < ARRAYSIZE(stkFile); i++) {
+ // initialize curPos to start of file
+ byte *curPos = data;
+
+ while (curPos < data + fileSize) {
+ // search for known first entry of STK files
+ if (!memcmp(curPos, stkFile[i].firstEntryName, strlen(stkFile[i].firstEntryName))) {
+ byte *stkFileStart = curPos - 2; // the actual STK start is 2 bytes prior
+ uint16 numStkEntries = READ_LE_UINT16(stkFileStart); // read number of entries in STK file
+ assert(numStkEntries > 0 && numStkEntries < 0xFF);
+
+ // Determine length of file by adding offset and size of the last entry
+ const uint32 lastEntrySize = READ_LE_UINT32(curPos + ((numStkEntries - 1) * STK_HEADER_ENTRY_SIZE) + 13);
+ const uint32 lastEntryOffset = READ_LE_UINT32(curPos + ((numStkEntries - 1) * STK_HEADER_ENTRY_SIZE) + 17);
+ const uint32 stkEntrySize = lastEntryOffset + lastEntrySize;
+
+ print("Found '%s' at %x (size: %d). Extracting...\n", stkFile[i].stkFilename, curPos - data - 2, stkEntrySize);
+
+ // write STK file
+ Common::File output;
+ _outputPath.setFullName(stkFile[i].stkFilename);
+ output.open(_outputPath, "wb");
+ assert(output.isOpen());
+ output.write(stkFileStart, stkEntrySize);
+ output.close();
+ stkFile[i].extracted = true;
+
+ curPos += stkEntrySize;
+ }
+
+ curPos++;
+ }
+ }
+
+ for (int i = 0; i < ARRAYSIZE(stkFile); i++) {
+ if (!stkFile[i].extracted)
+ error("A problem occurred: '%s' has NOT been extracted", stkFile[i].stkFilename);
+ }
+
+ delete[] data;
+}
+
+
+#ifdef STANDALONE_MAIN
+int main(int argc, char *argv[]) {
+ ExtractFascinationCD fe(argv[0]);
+ return fe.run(argc, argv);
+}
+#endif
+
Copied: tools/branches/gsoc2010-decompiler/engines/gob/extract_fascination_cd.h (from rev 54951, tools/trunk/engines/gob/extract_fascination_cd.h)
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/gob/extract_fascination_cd.h (rev 0)
+++ tools/branches/gsoc2010-decompiler/engines/gob/extract_fascination_cd.h 2010-12-18 12:49:08 UTC (rev 54952)
@@ -0,0 +1,36 @@
+/* extract_fascination_cd - a tool for extracting .stk archives from a mode1/2048 Fascination CD image
+ * Copyright (C) 2010 The ScummVM Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: $
+ * $Id: $
+ *
+ */
+
+#ifndef EXTRACT_FASCINATION_CD_H
+#define EXTRACT_FASCINATION_CD_H
+
+#include "compress.h"
+
+class ExtractFascinationCD : public Tool {
+public:
+ ExtractFascinationCD(const std::string &name = "extract_fascination_cd");
+
+ virtual void execute();
+};
+
+#endif
+
Modified: tools/branches/gsoc2010-decompiler/engines/kyra/compress_kyra.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/kyra/compress_kyra.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/kyra/compress_kyra.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -55,6 +55,9 @@
Common::Filename &outpath = _outputPath;
outpath.setFullName(inpath.getFullName());
+ if (outpath.hasExtension("AUD"))
+ outpath.setExtension("");
+
if (inpath == outpath)
error("Infile and outfile cannot be the same file");
Modified: tools/branches/gsoc2010-decompiler/engines/mohawk/archive.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/mohawk/archive.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/mohawk/archive.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -217,12 +217,13 @@
// We need to do this because of the way Mohawk is set up (this is much more "proper"
// than passing _mhk at the right offset). We may want to do that in the future, though.
if (_types[typeIndex].tag == ID_TMOV) {
- if (fileTableIndex == _fileTableAmount)
+ if (fileTableIndex == _fileTableAmount - 1)
output.stream = new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _mhk->size());
else
output.stream = new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _fileTable[fileTableIndex + 1].offset);
} else
output.stream = new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _fileTable[fileTableIndex].offset + _fileTable[fileTableIndex].dataSize);
+
output.tag = tag;
output.id = id;
output.index = fileTableIndex;
@@ -255,9 +256,12 @@
// For some unknown reason, all tMOV resources have incorrect sizes. We correct this by getting the differences between offsets.
uint32 dataSize = 0;
- if (_types[_curExType].tag == ID_TMOV)
- dataSize = _fileTable[fileTableIndex + 1].offset - _fileTable[fileTableIndex].offset;
- else
+ if (_types[_curExType].tag == ID_TMOV) {
+ if (fileTableIndex == _fileTableAmount - 1)
+ dataSize = _mhk->size() - _fileTable[fileTableIndex].offset;
+ else
+ dataSize = _fileTable[fileTableIndex + 1].offset - _fileTable[fileTableIndex].offset;
+ } else
dataSize = _fileTable[fileTableIndex].dataSize;
output.stream = new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _fileTable[fileTableIndex].offset + dataSize, false);
@@ -349,8 +353,8 @@
for (uint16 j = 0; j < _types[i].resTable.resources; j++) {
_types[i].resTable.entries[j].id = _mhk->readUint16LE();
_types[i].resTable.entries[j].offset = _mhk->readUint32LE();
- _types[i].resTable.entries[j].size = _mhk->readUint16LE();
- _mhk->readUint32LE(); // Unknown (always 0?)
+ _types[i].resTable.entries[j].size = _mhk->readUint32LE();
+ _mhk->readUint16LE(); // Unknown (always 0?)
debug (4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].offset, _types[i].resTable.entries[j].size);
}
@@ -410,6 +414,50 @@
return output;
}
+void CSWorldDeluxeArchive::open(Common::SeekableReadStream *stream) {
+ close();
+ _mhk = stream;
+
+ // CSWorld Deluxe uses another similar format, but with less features
+ // then the next archive version. There is no possibility for a name
+ // table here and is the simplest of the three formats.
+
+ uint32 typeTableOffset = _mhk->readUint32LE();
+
+ _mhk->seek(typeTableOffset);
+
+ _typeTable.resource_types = _mhk->readUint16LE();
+ _types = new OldType[_typeTable.resource_types];
+
+ debug (0, "CSWorld Deluxe File: Number of Resource Types = %04x", _typeTable.resource_types);
+
+ for (uint16 i = 0; i < _typeTable.resource_types; i++) {
+ _types[i].tag = _mhk->readUint32LE();
+ _types[i].resource_table_offset = _mhk->readUint16LE();
+
+ debug (3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(_types[i].tag), _types[i].resource_table_offset);
+
+ uint32 oldPos = _mhk->pos();
+
+ // Resource Table/File Table
+ _mhk->seek(_types[i].resource_table_offset + typeTableOffset);
+ _types[i].resTable.resources = _mhk->readUint16LE();
+ _types[i].resTable.entries = new OldType::ResourceTable::Entries[_types[i].resTable.resources];
+
+ for (uint16 j = 0; j < _types[i].resTable.resources; j++) {
+ _types[i].resTable.entries[j].id = _mhk->readUint16LE();
+ _types[i].resTable.entries[j].offset = _mhk->readUint32LE() + 1; // Need to add one to the offset!
+ _types[i].resTable.entries[j].size = (_mhk->readUint32LE() & 0xfffff); // Seems only the bottom 20 bits are valid (top two bytes might be flags?)
+ _mhk->readByte(); // Unknown (always 0?)
+
+ debug (4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].offset, _types[i].resTable.entries[j].size);
+ }
+
+ _mhk->seek(oldPos);
+ debug (3, "\n");
+ }
+}
+
MohawkArchive *MohawkArchive::createMohawkArchive(Common::SeekableReadStream *stream) {
uint32 headerTag = stream->readUint32BE();
@@ -420,11 +468,31 @@
headerTag = stream->readUint32BE();
if (headerTag == ID_RSRC)
mohawkArchive = new MohawkArchive();
- } else if (headerTag == ID_LBRC) {
- printf("Detected Living Books v2 archive - not yet supported!\n");
} else if (headerTag == 6 || SWAP_BYTES_32(headerTag) == 6) {
// Assume the Living Books v1 archive format
mohawkArchive = new LivingBooksArchive_v1();
+ } else {
+ headerTag = SWAP_BYTES_32(headerTag);
+ // Use a simple heuristic for testing if it's a CSWorld Deluxe file
+ if (headerTag + 2 < stream->size()) {
+ stream->seek(headerTag);
+ uint16 typeCount = stream->readUint16LE();
+
+ if (typeCount * 6 + stream->pos() < stream->size()) {
+ bool isDeluxeArchive = true;
+
+ for (uint16 i = 0; i < typeCount; i++) {
+ stream->readUint32LE(); // Ignore tag
+ if (stream->readUint16LE() + headerTag >= stream->size()) {
+ isDeluxeArchive = false;
+ break;
+ }
+ }
+
+ if (isDeluxeArchive)
+ mohawkArchive = new CSWorldDeluxeArchive();
+ }
+ }
}
stream->seek(0);
Modified: tools/branches/gsoc2010-decompiler/engines/mohawk/archive.h
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/mohawk/archive.h 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/mohawk/archive.h 2010-12-18 12:49:08 UTC (rev 54952)
@@ -31,7 +31,6 @@
// Main FourCC's
#define ID_MHWK MKID_BE('MHWK') // Main FourCC
#define ID_RSRC MKID_BE('RSRC') // Resource Directory Tag
-#define ID_LBRC MKID_BE('LBRC') // Living Books v2 FourCC
// Myst Resource FourCC's
#define ID_CLRC MKID_BE('CLRC') // Cursor Hotspots
@@ -236,11 +235,11 @@
LivingBooksArchive_v1() : MohawkArchive() {}
~LivingBooksArchive_v1() {}
- void open(Common::SeekableReadStream *stream);
+ virtual void open(Common::SeekableReadStream *stream);
MohawkOutputStream getRawData(uint32 tag, uint16 id);
MohawkOutputStream getNextFile();
-private:
+protected:
struct OldType {
uint32 tag;
uint16 resource_table_offset;
@@ -269,4 +268,11 @@
}
};
+class CSWorldDeluxeArchive : public LivingBooksArchive_v1 {
+public:
+ CSWorldDeluxeArchive() : LivingBooksArchive_v1() {}
+ ~CSWorldDeluxeArchive() {}
+ void open(Common::SeekableReadStream *stream);
+};
+
#endif
Modified: tools/branches/gsoc2010-decompiler/engines/sci/compress_sci.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/sci/compress_sci.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/sci/compress_sci.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -361,7 +361,7 @@
if (_inputOffset != _inputSize)
warning("resource file has additional byte before end-of-file\n");
- print("Valid sci audio resource file. Found %d resources", resourceCount);
+ print("Valid sci audio resource file. Found %d resources\n", resourceCount);
if (outfile.empty())
error("please specify an output file");
Modified: tools/branches/gsoc2010-decompiler/engines/scumm/descumm-common.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/scumm/descumm-common.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/scumm/descumm-common.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -242,3 +242,127 @@
pendingElse = false;
}
}
+
+char *put_ascii(char *buf, int i) {
+ if (i > 31 && i < 128) {
+ // non-printable chars are escaped by backslashes as so: "\x00"
+ // backslashes and quote marks are escaped like so: "\\" "\""
+ if (i == '\\' || i == '"') {
+ buf[0] = '\\';
+ buf++;
+ }
+ buf[0] = i;
+ buf[1] = 0;
+ return buf + 1;
+ }
+ return buf + sprintf(buf, "\\x%.2X", i);
+}
+
+extern char *get_var(char *buf);
+extern char *get_var6(char *buf);
+
+char *get_string(char *buf) {
+ byte cmd;
+ char *e = buf;
+ bool in = false;
+ bool in_function = false;
+ int i;
+
+ while ((cmd = get_byte()) != 0) {
+ if (cmd == 0xFF || cmd == 0xFE) {
+ if (in) {
+ e += sprintf(e, "\" + ");
+ in = false;
+ }
+ in_function = true;
+ i = get_byte();
+ switch (i) {
+ case 1: // newline
+ e += sprintf(e, "newline()");
+ break;
+ case 2:
+ e += sprintf(e, "keepText()");
+ break;
+ case 3:
+ e += sprintf(e, "wait()");
+ break;
+ case 4: // addIntToStack
+ e += sprintf(e, "getInt(");
+ goto addVarToStack;
+ case 5: // addVerbToStack
+ e += sprintf(e, "getVerb(");
+ goto addVarToStack;
+ case 6: // addNameToStack
+ e += sprintf(e, "getName(");
+ goto addVarToStack;
+ case 7: // addStringToStack
+ e += sprintf(e, "getString(");
+ addVarToStack:
+ if (g_options.scriptVersion >= 6) {
+ e = get_var6(e);
+ } else {
+ e = get_var(e);
+ }
+ e += sprintf(e, ")");
+ break;
+ case 9:
+ e += sprintf(e, "startAnim(%d)", get_word());
+ break;
+ case 10:
+ e += sprintf(e, "sound(");
+ // positions 2, 3, 6, 7 are the offset in MONSTER.SOU (LE).
+ // positions 10, 11, 14, 15 are the VCTL block size (LE).
+ {
+ // show the voice's position in the MONSTER.SOU
+ int p = 0;
+ p += get_word();
+ g_scriptCurPos += 2; // skip the next "0xFF 0x0A"
+ p += get_word() << 2;
+ e += sprintf(e, "0x%X, ", p);
+
+ g_scriptCurPos += 2; // skip the next "0xFF 0x0A"
+
+ // show the size of the VCTL chunk/lip-synch tags
+ p = 0;
+ p += get_word();
+ g_scriptCurPos += 2; // skip the next "0xFF 0x0A"
+ p += get_word() << 2;
+ e += sprintf(e, "0x%X)", p);
+ }
+ break;
+ case 12:
+ e += sprintf(e, "setColor(%d)", get_word());
+ break;
+ case 13: // was unk2
+ e += sprintf(e, "unknown13(%d)", get_word());
+ break;
+ case 14:
+ e += sprintf(e, "setFont(%d)", get_word());
+ break;
+ case 32: // Workaround for a script bug in Indy3
+ case 46: // Workaround for a script bug in Indy3
+ if (g_options.scriptVersion == 3 && g_options.IndyFlag) {
+ buf += sprintf(buf, "\\x%.2X", 0xE1); // should output German "sz" in-game.
+ continue;
+ }
+ // fall-through
+ default:
+ e += sprintf(e, "unknown%d(%d)", i, get_word());
+ }
+ } else {
+ if (in_function) {
+ e += sprintf(e, " + ");
+ in_function = false;
+ }
+ if (!in) {
+ *e++ = '"';
+ in = true;
+ }
+ e = put_ascii(e, cmd);
+ }
+ }
+ if (in)
+ *e++ = '"';
+ *e = 0;
+ return e;
+}
Modified: tools/branches/gsoc2010-decompiler/engines/scumm/descumm.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/scumm/descumm.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/scumm/descumm.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -568,51 +568,7 @@
return strecpy(buf, "]");
}
-char *putascii(char *buf, int i) {
- if (i > 31 && i < 128) {
- // non-printable chars are escaped by backslashes as so: "\x00"
- // backslashes and quote marks are escaped like so: "\\" "\""
- if (i == '\\' || i == '"') {
- buf[0] = '\\';
- buf++;
- }
- buf[0] = i;
- buf[1] = 0;
- return buf + 1;
- }
- return buf + sprintf(buf, "\\x%.2X", i);
-}
-char *get_ascii(char *buf) {
- int i;
-
- buf = strecpy(buf, "\"");
-
- do {
- i = get_byte();
- if (!i)
- break;
- buf = putascii(buf, i);
- if (i == 255) {
- i = get_byte();
- buf = putascii(buf, i);
-
- // Workaround for a script bug in Indy3
- if (i == 46 && g_options.scriptVersion == 3 && g_options.IndyFlag)
- continue;
-
- if (i != 1 && i != 2 && i != 3 && i != 8) {
- buf = putascii(buf, get_byte());
- buf = putascii(buf, get_byte());
- }
- }
- } while (1);
-
- return strecpy(buf, "\"");
-}
-
-
-
char *add_a_tok(char *buf, int type) {
switch (type) {
case TOK_BYTE:
@@ -628,11 +584,11 @@
buf = get_list(buf);
break;
case TOK_ASCII:
- buf = get_ascii(buf);
+ buf = get_string(buf);
break;
case TOK_CHAR:
error("this code seems to be dead");
- buf = putascii(buf, get_byte());
+ buf = put_ascii(buf, get_byte());
break;
}
return buf;
@@ -681,7 +637,7 @@
} else {
if (!(args & ANOLASTPAREN)) {
buf = strecpy(buf, ")");
- }
+ }
if (!(args & ANOENDSEMICOLON) && buf[(strlen(buf) - 1)] != ';') {
buf = strecpy(buf, ";");
}
@@ -955,7 +911,7 @@
buf = strchr(strcpy(buf, "PutCodeInString("), 0);
buf = get_var_or_byte(buf, opcode & 0x80);
buf = strchr(strcpy(buf, ", "), 0);
- buf = get_ascii(buf);
+ buf = get_string(buf);
strcpy(buf, ");");
}
@@ -1477,7 +1433,7 @@
break;
case 0xF:{
buf = strecpy(buf, "Text(");
- buf = get_ascii(buf);
+ buf = get_string(buf);
buf = strecpy(buf, ")");
}
goto exit_proc;
@@ -1934,10 +1890,10 @@
case 0xF9:{
buf = strecpy(buf, "doSentence(");
if (!(opcode & 0x80) && *g_scriptCurPos == 0xFC) {
- strcpy(buf, "STOP)");
+ strcpy(buf, "STOP);");
g_scriptCurPos++;
} else if (!(opcode & 0x80) && *g_scriptCurPos == 0xFB) {
- strcpy(buf, "RESET)");
+ strcpy(buf, "RESET);");
g_scriptCurPos++;
} else {
do_tok(buf, "",
@@ -2313,7 +2269,7 @@
int i;
char first = 1;
- buf = do_tok(buf, "setVarRange", A1V | ANOLASTPAREN);
+ buf = do_tok(buf, "setVarRange", A1V | ANOLASTPAREN | ANOENDSEMICOLON);
i = get_byte();
buf += sprintf(buf, ",%d,[", i);
@@ -3284,7 +3240,7 @@
buf = strecpy(buf, "doSentence(");
// FIXME: this is not exactly what ScummVM does...
if (!(opcode & 0x80) && (*g_scriptCurPos == 0xFE)) {
- strcpy(buf, "STOP)");
+ strcpy(buf, "STOP);");
g_scriptCurPos++;
} else {
do_tok(buf, "",
@@ -3367,7 +3323,7 @@
case 0xFF:
buf =
do_tok(buf, "drawBox",
- ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | ANOLASTPAREN);
+ ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | ANOLASTPAREN | ANOENDSEMICOLON);
opcode = get_byte();
do_tok(buf, NULL,
ASTARTCOMMA | ANOFIRSTPAREN | ((opcode & 0x80) ? A1V : A1W) |
@@ -3510,7 +3466,7 @@
int i;
char first = 1;
- buf = do_tok(buf, "setVarRange", A1V | ANOLASTPAREN);
+ buf = do_tok(buf, "setVarRange", A1V | ANOLASTPAREN | ANOENDSEMICOLON);
i = get_byte();
buf += sprintf(buf, ",%d,[", i);
@@ -3674,7 +3630,7 @@
break;
case 0x03:
buf += sprintf(buf, ", Open(");
- buf = get_ascii(buf);
+ buf = get_string(buf);
buf += sprintf(buf, ")");
break;
case 0x04:
Modified: tools/branches/gsoc2010-decompiler/engines/scumm/descumm.h
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/scumm/descumm.h 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/scumm/descumm.h 2010-12-18 12:49:08 UTC (rev 54952)
@@ -160,6 +160,9 @@
extern void outputLine(const char *buf, int curoffs, int opcode, int indent);
+extern char *put_ascii(char *buf, int i);
+extern char *get_string(char *buf);
+
extern char *strecpy(char *buf, const char *src);
extern int get_curoffs();
extern int get_byte();
Modified: tools/branches/gsoc2010-decompiler/engines/scumm/descumm6.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/engines/scumm/descumm6.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/engines/scumm/descumm6.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -1063,6 +1063,11 @@
return new ListStackEnt(pop());
}
+char *get_var6(char *buf) {
+ VarStackEnt tmp(get_word());
+ return tmp.asText(buf);
+}
+
void invalidop(const char *cmd, int op) {
if (cmd)
error("Unknown opcode %s:0x%x (stack count %d)", cmd, op, num_stack);
@@ -1159,71 +1164,10 @@
delete se;
}
+
StackEnt *se_get_string() {
- byte cmd;
char buf[1024];
- char *e = buf;
- bool in = false;
- int i;
-
- while ((cmd = get_byte()) != 0) {
- if (cmd == 0xFF || cmd == 0xFE) {
- if (in) {
- *e++ = '"';
- in = false;
- }
- i = get_byte();
- switch (i) {
- case 1:
- e += sprintf(e, ":newline:");
- break;
- case 2:
- e += sprintf(e, ":keeptext:");
- break;
- case 3:
- e += sprintf(e, ":wait:");
- break;
- case 4: // addIntToStack
- case 5: // addVerbToStack
- case 6: // addNameToStack
- case 7: // addStringToStack
- {
- VarStackEnt tmp(get_word());
- e += sprintf(e, ":");
- e = tmp.asText(e);
- e += sprintf(e, ":");
- }
- break;
- case 9:
- e += sprintf(e, ":startanim=%d:", get_word());
- break;
- case 10:
- e += sprintf(e, ":sound:");
- g_scriptCurPos += 14;
- break;
- case 14:
- e += sprintf(e, ":setfont=%d:", get_word());
- break;
- case 12:
- e += sprintf(e, ":setcolor=%d:", get_word());
- break;
- case 13:
- e += sprintf(e, ":unk2=%d:", get_word());
- break;
- default:
- e += sprintf(e, ":unk%d=%d:", i, get_word());
- }
- } else {
- if (!in) {
- *e++ = '"';
- in = true;
- }
- *e++ = cmd;
- }
- }
- if (in)
- *e++ = '"';
- *e = 0;
+ get_string(buf); // ignore returned value
return se_complex(buf);
}
Modified: tools/branches/gsoc2010-decompiler/gui/pages.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/gui/pages.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/gui/pages.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -377,7 +377,7 @@
sizer->Add(new wxStaticText(panel, wxID_ANY,
wxT("Select an input file, if you have two input files (CD1 and CD2), ")
wxT("you will be queried for the other file later.")
- wxT("You can also drag & drop a file on this window.")
+ wxT("You can also drag && drop a file on this window.")
),
wxSizerFlags(1).Expand());
Modified: tools/branches/gsoc2010-decompiler/tools.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/tools.cpp 2010-12-18 12:22:15 UTC (rev 54951)
+++ tools/branches/gsoc2010-decompiler/tools.cpp 2010-12-18 12:49:08 UTC (rev 54952)
@@ -48,6 +48,7 @@
#include "engines/cine/extract_cine.h"
#include "engines/cruise/extract_cruise_pc.h"
#include "engines/gob/extract_gob_stk.h"
+#include "engines/gob/extract_fascination_cd.h"
#include "engines/kyra/extract_kyra.h"
#include "engines/scumm/extract_loom_tg16.h"
#include "engines/scumm/extract_mm_apple.h"
@@ -82,6 +83,7 @@
_tools.push_back(new ExtractCine());
_tools.push_back(new ExtractCruisePC());
_tools.push_back(new ExtractGobStk());
+ _tools.push_back(new ExtractFascinationCD());
_tools.push_back(new ExtractKyra());
_tools.push_back(new ExtractLoomTG16());
_tools.push_back(new ExtractMMApple());
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