[Scummvm-cvs-logs] SF.net SVN: scummvm:[34120] tools/trunk

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Aug 24 21:01:40 CEST 2008


Revision: 34120
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34120&view=rev
Author:   drmccoy
Date:     2008-08-24 19:01:38 +0000 (Sun, 24 Aug 2008)

Log Message:
-----------
Added a STK/ITK-extractor and a gob script decompiler

Modified Paths:
--------------
    tools/trunk/Makefile

Added Paths:
-----------
    tools/trunk/degob.cpp
    tools/trunk/degob_script.cpp
    tools/trunk/degob_script.h
    tools/trunk/degob_script_bargon.cpp
    tools/trunk/degob_script_v1.cpp
    tools/trunk/degob_script_v2.cpp
    tools/trunk/degob_script_v3.cpp
    tools/trunk/degob_script_v4.cpp
    tools/trunk/extract_gob_stk.cpp

Modified: tools/trunk/Makefile
===================================================================
--- tools/trunk/Makefile	2008-08-24 07:54:36 UTC (rev 34119)
+++ tools/trunk/Makefile	2008-08-24 19:01:38 UTC (rev 34120)
@@ -71,6 +71,7 @@
 	dekyra$(EXEEXT) \
 	descumm$(EXEEXT) \
 	desword2$(EXEEXT) \
+	degob$(EXEEXT) \
 	encode_dxa$(EXEEXT) \
 	extract_agos$(EXEEXT) \
 	extract_kyra$(EXEEXT) \
@@ -81,6 +82,7 @@
 	extract_parallaction$(EXEEXT) \
 	extract_scumm_mac$(EXEEXT) \
 	extract_zak_c64$(EXEEXT) \
+	extract_gob_stk$(EXEEXT) \
 	tools_gui$(EXEEXT)
 
 UTILS := \
@@ -143,6 +145,9 @@
 desword2$(EXEEXT): desword2.o util.o
 	$(CXX) $(LDFLAGS) -o $@ $+
 
+degob$(EXEEXT): degob.o degob_script.o degob_script_v1.o degob_script_v2.o degob_script_v3.o degob_script_v4.o degob_script_bargon.o util.o
+	$(CXX) $(LDFLAGS) -o $@ $+
+
 encode_dxa$(EXEEXT): encode_dxa.o compress.o util.o
 	$(CXX) $(LDFLAGS) -o $@ $+ -lpng -lz -lvorbis -logg -lvorbisenc -lFLAC
 
@@ -173,6 +178,9 @@
 extract_zak_c64$(EXEEXT): extract_zak_c64.o util.o
 	$(CXX) $(LDFLAGS) -o $@ $+
 
+extract_gob_stk$(EXEEXT): extract_gob_stk.o util.o
+	$(CXX) $(LDFLAGS) -o $@ $+
+
 tools_gui$(EXEEXT): tools_gui.o
 	$(CXX) $(LDFLAGS) -o $@ $+ `wx-config --libs`
 

Added: tools/trunk/degob.cpp
===================================================================
--- tools/trunk/degob.cpp	                        (rev 0)
+++ tools/trunk/degob.cpp	2008-08-24 19:01:38 UTC (rev 34120)
@@ -0,0 +1,181 @@
+/* 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 <iostream>
+
+void printHelp(const char *bin);
+int getVersion(const char *verStr);
+byte *readFile(FILE *tot, uint32 &size);
+Script *initScript(byte *totData, uint32 totSize, ExtTable *extTable, int version);
+void printInfo(Script &script);
+
+int main(int argc, char **argv) {
+
+	if ((argc < 3) || !strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
+		printHelp(argv[0]);
+		return -1;
+	}
+
+	int version = getVersion(argv[1]);
+	if (version == -1) {
+		printHelp(argv[0]);
+		return -1;
+	}
+
+	FILE *f;
+	byte *totData = 0, *extData = 0, *extComData = 0;
+	uint32 totSize = 0, extSize = 0, extComSize = 0;
+
+	if (!(f = fopen(argv[2], "r")))
+		error("Couldn't open file \"%s\"", argv[2]);
+	totData = readFile(f, totSize);
+	fclose(f);
+
+	ExtTable *extTable = 0;
+	if (argc > 3) {
+		if (!(f = fopen(argv[3], "r")))
+			error("Couldn't open file \"%s\"", argv[3]);
+		extData = readFile(f, extSize);
+		fclose(f);
+
+		if (argc > 4) {
+			if (!(f = fopen(argv[4], "r")))
+				error("Couldn't open file \"%s\"", argv[4]);
+			extComData = readFile(f, extComSize);
+			fclose(f);
+		}
+
+		extTable = new ExtTable(extData, extSize, extComData, extComSize);
+	}
+
+	Script *script = initScript(totData, totSize, extTable, version);
+	if (!script) {
+		printHelp(argv[0]);
+		return -1;
+	}
+
+	printInfo(*script);
+	printf("-----\n");
+
+	script->deGob();
+
+	delete[] totData;
+	delete[] extData;
+	delete[] extComData;
+	delete extTable;
+	delete script;
+	return 0;
+}
+
+void printHelp(const char *bin) {
+	printf("Usage: %s <version> <file.tot> [<file.ext>] [<commun.ext>]\n\n", bin);
+	printf("The disassembled script will be written to stdout.\n\n");
+	printf("Supported versions:\n");
+	printf("	Gob1     - Gobliiins 1\n");
+	printf("	Gob2     - Gobliins 2\n");
+	printf("	Gob3     - Goblins 3\n");
+	printf("	Ween     - Ween: The Prophecy\n");
+	printf("	Bargon   - Bargon Attack\n");
+	printf("	Lost     - Lost in Time\n");
+	printf("	Woodruff - The Bizarre Adventures of Woodruff and the Schnibble\n");
+}
+
+int getVersion(const char *verStr) {
+	if (!scumm_stricmp(verStr, "Gob1"))
+		return 0;
+	else if (!scumm_stricmp(verStr, "Gob2"))
+		return 1;
+	else if (!scumm_stricmp(verStr, "Gob3"))
+		return 2;
+	else if (!scumm_stricmp(verStr, "Ween"))
+		return 3;
+	else if (!scumm_stricmp(verStr, "Bargon"))
+		return 4;
+	else if (!scumm_stricmp(verStr, "Lost"))
+		return 5;
+	else if (!scumm_stricmp(verStr, "Woodruff"))
+		return 6;
+
+	return -1;
+}
+
+byte *readFile(FILE *tot, uint32 &size) {
+	size = fileSize(tot);
+	byte *data = new byte[size];
+
+	fread(data, size, 1, tot);
+	return data;
+}
+
+Script *initScript(byte *totData, uint32 totSize, ExtTable *extTable, int version) {
+	switch (version) {
+		case 0:
+			return new Script_v1(totData, totSize, extTable);
+			break;
+		case 1:
+			return new Script_v2(totData, totSize, extTable);
+			break;
+		case 2:
+			return new Script_v3(totData, totSize, extTable);
+			break;
+		case 3:
+			return new Script_v2(totData, totSize, extTable);
+			break;
+		case 4:
+			return new Script_Bargon(totData, totSize, extTable);
+			break;
+		case 5:
+			return new Script_v3(totData, totSize, extTable);
+			break;
+		case 6:
+			return new Script_v4(totData, totSize, extTable);
+			break;
+	}
+	return 0;
+}
+
+void printInfo(Script &script) {
+	printf("Version (script behaviour): %d\n", script.getVerScript());
+	printf("Version (IM/EX loading): %d\n", script.getVerIMEX());
+	printf("IM file suffix: %d\n", script.getSuffixIM());
+	printf("EX file suffix: %d\n", script.getSuffixEX());
+
+	printf("Game texts: ");
+	if (script.getTotTextCount() == 0)
+		printf("Read out of language specific files\n");
+	else if (script.getTotTextCount() == 0xFFFFFFFF)
+		printf("None\n");
+	else
+		printf("%d, directly embedded in the TOT\n", script.getTotTextCount());
+
+	printf("Resources: ");
+	if (script.getTotResOffset() != 0xFFFFFFFF)
+		printf("%d, starting at 0x%08X\n", script.getTotResCount(), script.getTotResOffset());
+	else
+		printf("None\n");
+
+	printf("# of variables: %d (%d bytes)\n", script.getVarsCount(), script.getVarsCount() * 4);
+	printf("AnimDataSize: %d bytes\n", script.getAnimDataSize());
+	printf("Text center code starts at: 0x%04X\n", script.getTextCenter());
+	printf("Script code starts at: 0x%04X\n", script.getStart());
+}


Property changes on: tools/trunk/degob.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: tools/trunk/degob_script.cpp
===================================================================
--- tools/trunk/degob_script.cpp	                        (rev 0)
+++ tools/trunk/degob_script.cpp	2008-08-24 19:01:38 UTC (rev 34120)
@@ -0,0 +1,814 @@
+/* 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 <stdarg.h>
+
+#ifdef _MSC_VER
+	#define	vsnprintf _vsnprintf
+#endif
+
+ExtTable::ExtTable(byte *data, uint32 size, byte *dataCom, uint32 sizeCom) :
+	_data(data), _size(size), _dataCom(dataCom), _sizeCom(sizeCom) {
+
+	assert(data && (size >= 3));
+
+	init();
+}
+
+ExtTable::~ExtTable() {
+	delete[] _items;
+}
+
+void ExtTable::init() {
+	byte *data = _data;
+
+	_itemsCount = READ_LE_UINT16(data);
+	_items = _itemsCount ? new Item[_itemsCount] : 0;
+	data += 3;
+
+	assert(_size >= (uint32) (3 + _itemsCount * 10));
+
+	for (uint16 i = 0; i < _itemsCount; i++, data += 10) {
+		_items[i].offset = READ_LE_UINT32(data);
+		_items[i].size = READ_LE_UINT16(data + 4);
+		_items[i].width = READ_LE_UINT16(data + 6);
+		_items[i].height = READ_LE_UINT16(data + 8);
+		_items[i].isPacked = (_items[i].width & 0x8000) != 0;
+
+		_items[i].width &= 0x7FFF;
+
+		if (_items[i].width & 0x4000)
+			_items[i].size += 1 << 16;
+		if (_items[i].width & 0x2000)
+			_items[i].size += 2 << 16;
+		if (_items[i].width & 0x1000)
+			_items[i].size += 4 << 16;
+		if (_items[i].height == 0)
+			_items[i].size += _items[i].width << 16;
+
+		_items[i].width &= 0xFFF;
+	}
+}
+
+byte *ExtTable::getItem(uint16 i, uint32 &size) const {
+	assert(i < _itemsCount);
+
+	Item &item = _items[i];
+	int32 offset = item.offset;
+	byte *data, *dataBuf;
+
+	if (offset < 0) {
+		offset = -(offset + 1);
+
+		if (!_dataCom)
+			error("commun.exN needed");
+
+		assert(((uint32) offset) < _sizeCom);
+
+		data = _dataCom;
+	} else {
+		assert(((uint32) offset) < _size);
+
+		data = _data + (3 + _itemsCount * 10);
+	}
+
+	size = item.size;
+
+	if (item.isPacked)
+		dataBuf = new byte[size + 2];
+	else
+		dataBuf = new byte[size];
+
+	memcpy(dataBuf, data + offset, size);
+
+	if (item.isPacked) {
+		byte *packedBuf = dataBuf;
+		dataBuf = unpack(packedBuf, size);
+		delete[] packedBuf;
+	}
+
+	return dataBuf;
+}
+
+// Some LZ77-variant
+byte *ExtTable::unpack(const byte *packedData, uint32 &size) const {
+	byte *dataBuf, *tmpBuf, *dest;
+	uint32 counter;
+	uint16 tmpIndex;
+	uint16 cmd;
+	int16 off;
+	byte len;
+
+	counter = size = READ_LE_UINT32(packedData);
+	dataBuf = new byte[size];
+
+	tmpBuf = new byte[4114];
+
+	for (int i = 0; i < 4078; i++)
+		tmpBuf[i] = 0x20;
+	tmpIndex = 4078;
+
+	packedData += 4;
+
+	dest = dataBuf;
+	cmd = 0;
+	while (1) {
+		cmd >>= 1;
+		if ((cmd & 0x0100) == 0) {
+			cmd = *packedData | 0xFF00;
+			packedData++;
+		}
+		if ((cmd & 1) != 0) { /* copy */
+			*dest++ = *packedData;
+			tmpBuf[tmpIndex] = *packedData;
+			packedData++;
+			tmpIndex++;
+			tmpIndex %= 4096;
+			counter--;
+			if (counter == 0)
+				break;
+		} else { /* copy string */
+
+			off = *packedData++;
+			off |= (*packedData & 0xF0) << 4;
+			len = (*packedData & 0x0F) + 3;
+			packedData++;
+
+			for (int i = 0; i < len; i++) {
+				*dest++ = tmpBuf[(off + i) % 4096];
+				counter--;
+				if (counter == 0) {
+					delete[] tmpBuf;
+					return dataBuf;
+				}
+				tmpBuf[tmpIndex] = tmpBuf[(off + i) % 4096];
+				tmpIndex++;
+				tmpIndex %= 4096;
+			}
+
+		}
+	}
+	delete[] tmpBuf;
+
+	return dataBuf;
+}
+
+Script::Script(byte *totData, uint32 totSize, ExtTable *extTable) :
+	_totData(totData), _ptr(totData), _totSize(totSize), _extTable(extTable) {
+
+	assert((totData > 0) && (totSize > 128));
+
+	_indent = 0;
+
+	loadProperties(totData);
+}
+Script::~Script() {}
+
+uint16 Script::getStart() const { return _start; }
+uint16 Script::getTextCenter() const { return _textCenter; }
+uint16 Script::getVarsCount() const { return _varsCount; }
+uint32 Script::getTotTextCount() const { return _totTextCount; }
+uint32 Script::getTotResOffset() const { return _totResOffset; }
+uint16 Script::getTotResCount() const { return _totResCount; }
+uint16 Script::getAnimDataSize() const { return _animDataSize; }
+uint8 Script::getVerScript() const { return _verScript; }
+uint8 Script::getVerIMEX() const { return _verIMEX; }
+uint8 Script::getSuffixIM() const { return _suffixIM; }
+uint8 Script::getSuffixEX() const { return _suffixEX; }
+
+void Script::putString(const char *s) const {
+	printf("%s", s);
+}
+void Script::print(const char *s, ...) const {
+	char buf[1024];
+	va_list va;
+
+	va_start(va, s);
+	vsnprintf(buf, 1024, s, va);
+	va_end(va);
+
+	putString(buf);
+}
+void Script::printIndent() const {
+	print("%08d:", getPos());
+	for (uint32 i = 0; i < _indent; i++)
+		putString("	");
+}
+void Script::printLine(const char *str) const {
+	printIndent(); putString(str); putString("\n");
+}
+std::string Script::printStr(const char *s, ...) const {
+	char buf[1024];
+	va_list va;
+
+	va_start(va, s);
+	vsnprintf(buf, 1024, s, va);
+	va_end(va);
+
+	return buf;
+}
+
+void Script::incIndent() { _indent++; }
+void Script::decIndent() { _indent--; }
+
+uint32 Script::getPos() const { return _ptr - _totData; }
+void Script::skip(uint32 off) { seek(off, SEEK_CUR); }
+void Script::seek(uint32 off, int whence) {
+	switch (whence) {
+	case SEEK_END:
+		off = _totSize - off;
+	case SEEK_SET:
+		_ptr = _totData + off;
+	break;
+
+	case SEEK_CUR:
+		_ptr += (int32) off;
+		break;
+	}
+}
+
+uint8  Script::peekUint8()  const { return *_ptr; }
+uint16 Script::peekUint16() const { return READ_LE_UINT16(_ptr); }
+uint32 Script::peekUint32() const { return READ_LE_UINT32(_ptr); }
+uint8  Script::readUint8()        { uint8  i = peekUint8();  _ptr += 1; return i; }
+uint16 Script::readUint16()       { uint16 i = peekUint16(); _ptr += 2; return i; }
+uint32 Script::readUint32()       { uint32 i = peekUint32(); _ptr += 4; return i; }
+const char *Script::peekString() const { return (char *) _ptr; }
+const char *Script::readString()  { const char *i = peekString(); _ptr += strlen(i) + 1; return i; }
+
+void Script::skipExpr(char stopToken) {
+	int16 dimCount;
+	byte operation;
+	int16 num;
+	int16 dim;
+
+	num = 0;
+	while (1) {
+		operation = readUint8();
+
+		if ((operation >= 16) && (operation <= 29)) {
+			switch (operation) {
+			case 17:
+			case 18:
+			case 20:
+			case 23:
+			case 24:
+				skip(2);
+				break;
+
+			case 19:
+				skip(4);
+				break;
+
+			case 21:
+				skip(1);
+				break;
+
+			case 22:
+				skip(strlen((char *) _ptr) + 1);
+				break;
+
+			case 25:
+				skip(2);
+				if (peekUint8() == 13) {
+					skip(1);
+					skipExpr(12);
+				}
+				break;
+
+			case 16:
+			case 26:
+			case 27:
+			case 28:
+				dimCount = _ptr[2];
+				// skip header and dimensions
+				skip(3 + dimCount);
+				// skip indices
+				for (dim = 0; dim < dimCount; dim++)
+					skipExpr(12);
+
+				if ((operation == 28) && (peekUint8() == 13)) {
+					skip(1);
+					skipExpr(12);
+				}
+				break;
+
+			case 29:
+				skip(1);
+				skipExpr(10);
+			}
+			continue;
+		} // if ((operation >= 16) && (operation <= 29))
+
+		if (operation == 9) {
+			num++;
+			continue;
+		}
+
+		if ((operation == 11) || ((operation >= 1) && (operation <= 8)))
+			continue;
+
+		if ((operation >= 30) && (operation <= 37))
+			continue;
+
+		if (operation == 10)
+			num--;
+
+		if (operation != stopToken)
+			continue;
+
+		if ((stopToken != 10) || (num < 0))
+			return;
+	}
+}
+
+std::string Script::readExpr(char stopToken) {
+	std::string expr;
+	int16 dimCount;
+	byte operation;
+	int16 num;
+	int16 dim;
+	byte *arrDesc;
+	byte func;
+
+	num = 0;
+	while (1) {
+		operation = readUint8();
+
+		if ((operation >= 16) && (operation <= 29)) {
+			// operands
+
+			switch (operation) {
+			case 17: // uint16 variable load
+				expr += printStr("var16_%d", readUint16() * 2);
+				break;
+
+			case 18: // uint8 variable load:
+				expr += printStr("var8_%d", readUint16());
+				break;
+
+			case 19: // int32/uint32 immediate
+				expr += printStr("%d", readUint32());
+				break;
+
+			case 20: // int16 immediate
+				expr += printStr("%d", (int16) readUint16());
+				break;
+
+			case 21: // int8 immediate
+				expr += printStr("%d", (int8) readUint8());
+				break;
+
+			case 22: // string immediate
+				expr += printStr("\"%s\"", readString());
+				break;
+
+			case 23: // uint32 variable load
+			case 24: // uint32 variable load as uint16
+				expr += printStr("var32_%d", readUint16() * 4);
+				break;
+
+			case 25: // string variable load
+				expr += printStr("(&var8_%d)", readUint16() * 4);
+				if (peekUint8() == 13) {
+					skip(1);
+					expr += "+{*";
+					expr += readExpr(12); // this also prints the closing }
+				}
+				break;
+
+			case 16: // uint8 array access
+			case 26: // uint32 array access
+			case 27: // uint16 array access
+			case 28: // string array access
+
+				if (operation == 16)
+					expr += printStr("var8_%d[", readUint16());
+				else if (operation == 26)
+					expr += printStr("var32_%d[", readUint16() * 4);
+				else if (operation == 27)
+					expr += printStr("var16_%d[", readUint16() * 2);
+				else if (operation == 28)
+					expr += printStr("(&var8_%d[", readUint16() * 4);
+
+				dimCount = readUint8();
+				arrDesc = _ptr;
+				skip(dimCount);
+        for (dim = 0; dim < dimCount; dim++) {
+          expr += readExpr(12) + printStr(" of %d", (int16) arrDesc[dim]);
+					if (dim != dimCount - 1)
+						expr += "][";
+        }
+
+				expr += "]";
+				if (operation == 28)
+					expr += ")";
+
+				if ((operation == 28) && (peekUint8() == 13)) {
+					skip(1);
+					expr += "+{*" + readExpr(12);
+				}
+				break;
+
+			case 29: // function
+				func = readUint8();
+				if (func == 5)
+					expr += "sqr(";
+				else if (func == 10)
+					expr += "rand(";
+				else if (func == 7)
+					expr += "abs(";
+				else if ((func == 0) || (func == 1) || (func == 6))
+					expr += "sqrt(";
+				else
+					expr += "id(";
+				expr += readExpr(10);
+				break;
+			}
+			continue;
+		}		// if ((operation >= 16) && (operation <= 29))
+
+		// operators
+		switch (operation) {
+		case 9:
+			expr += "(";
+			break;
+
+		case 11:
+			expr += "!";
+			break;
+
+		case 10:
+			expr += ")";
+			break;
+
+		case 1:
+			expr += "-";
+			break;
+
+		case 2:
+			expr += "+";
+			break;
+
+		case 3:
+			expr += "-";
+			break;
+
+		case 4:
+			expr += "|";
+			break;
+
+		case 5:
+			expr += "*";
+			break;
+
+		case 6:
+			expr += "/";
+			break;
+
+		case 7:
+			expr += "%";
+			break;
+
+		case 8:
+			expr += "&";
+			break;
+
+		case 30:
+			expr += " || ";
+			break;
+
+		case 31:
+			expr += " && ";
+			break;
+
+		case 32:
+			expr += "<";
+			break;
+
+		case 33:
+			expr += "<=";
+			break;
+
+		case 34:
+			expr += ">";
+			break;
+
+		case 35:
+			expr += ">=";
+			break;
+
+		case 36:
+			expr += "==";
+			break;
+
+		case 37:
+			expr += "!=";
+			break;
+
+		case 99:
+//			expr += "\n";
+			break;
+
+		case 12:
+			expr += "}";
+			if (stopToken != 12)
+				warning("Closing paren without opening?");
+			break;
+
+		default:
+			while (((char) readUint8()) != stopToken);
+			return printStr("Invalid operator in expression: <%d>", (int16) operation);
+			break;
+		}
+
+		if (operation == 9) {
+			num++;
+			continue;
+		}
+
+		if ((operation == 11) || ((operation >= 1) && (operation <= 8)))
+			continue;
+
+		if ((operation >= 30) && (operation <= 37))
+			continue;
+
+		if (operation == 10)
+			num--;
+
+		if (operation == stopToken) {
+			if ((stopToken != 10) || (num < 0)) {
+				return expr;
+			}
+		}
+	}
+}
+
+std::string Script::readVarIndex() {
+	std::string expr;
+	byte *arrDesc;
+	int16 dim;
+	int16 dimCount;
+	int16 operation;
+	int16 temp;
+
+	operation = readUint8();
+	if ((operation == 16) || (operation == 18) || (operation == 25) || (operation == 28))
+		expr = "var8_";
+	else if ((operation == 17) || (operation == 24) || (operation == 27))
+		expr = "var16_";
+	else if ((operation == 23) || (operation == 26))
+		expr = "var32_";
+
+	switch (operation) {
+	case 23:
+	case 24:
+	case 25:
+		temp = readUint16() * 4;
+		expr += printStr("%d", temp);
+		if ((operation == 25) && (peekUint8() == 13)) {
+			skip(1);
+			expr += "+{*";
+			expr += readExpr(12);
+		}
+		break;
+
+	case 17:
+		expr += printStr("%d", readUint16() * 2);
+		break;
+
+	case 18:
+		expr += printStr("%d", readUint16());
+		break;
+
+	case 16:
+	case 26:
+	case 27:
+	case 28:
+		if (operation == 16)
+			expr += printStr("%d[", readUint16());
+		else if (operation == 26)
+			expr += printStr("%d[", readUint16() * 4);
+		else if (operation == 27)
+			expr += printStr("%d[", readUint16() * 2);
+		else if (operation == 28)
+			expr += printStr("%d[", readUint16() * 4);
+
+		dimCount = readUint8();
+		arrDesc = _ptr;
+		skip(dimCount);
+		for (dim = 0; dim < dimCount; dim++) {
+			expr += readExpr(12);
+			expr += printStr(" of %d", (int16) arrDesc[dim]);
+			if (dim != dimCount - 1)
+				expr += "][";
+		}
+		expr += "]";
+
+		if ((operation == 28) && (peekUint8() == 13)) {
+			skip(1);
+			expr += "+{*";
+			expr += readExpr(12);
+		}
+		break;
+
+	default:
+		expr += "var_0";
+		break;
+	}
+
+	return expr;
+}
+
+uint16 Script::getBlockSize() const {
+	return READ_LE_UINT16(_ptr + 2) + 2;
+}
+
+void Script::evaluateParams(const Param *params) {
+	bool first = true;
+
+	while (*params != PARAM_NONE) {
+		if (!first)
+			print(", ");
+		else
+			first = false;
+
+		switch (*params++) {
+		case PARAM_UINT8:
+			print("%u", readUint8());
+			break;
+
+		case PARAM_UINT16:
+			print("%u", readUint16());
+			break;
+
+		case PARAM_UINT32:
+			print("%u", readUint32());
+			break;
+
+		case PARAM_INT8:
+			print("%d", (int8) readUint8());
+			break;
+
+		case PARAM_INT16:
+			print("%d", (int16) readUint16());
+			break;
+
+		case PARAM_INT32:
+			print("%d", (int32) readUint32());
+			break;
+
+		case PARAM_STR:
+			print("\"%s\"", readString());
+			break;
+
+		case PARAM_EXPR:
+			print("%s", readExpr().c_str());
+			break;
+
+		case PARAM_VARINDEX:
+			print("%s", readVarIndex().c_str());
+			break;
+
+		default:
+			error("Unknown parameter type");
+			break;
+		}
+	}
+}
+
+void Script::printFuncDesc(const FuncParams &fParams, const Param *params) {
+	if (!fParams.desc)
+		return;
+
+	printIndent();
+	putString(fParams.desc);
+	putString("(");
+
+	if (params)
+		evaluateParams(params);
+
+	putString(");\n");
+}
+
+void Script::printFuncDesc(const FuncParams &fParams) const {
+	if (!fParams.desc)
+		return;
+
+	printIndent();
+	putString(fParams.desc);
+	putString("(");
+
+	print("%d, %d", fParams.objIndex, fParams.extraData);
+
+	putString(");\n");
+}
+
+void Script::startFunc(const FuncParams &fParams) const {
+	printIndent();
+	print("%s(", fParams.desc);
+}
+
+void Script::endFunc() const {
+	print(");\n");
+}
+
+void Script::loadProperties(byte *data) {
+	_start = READ_LE_UINT16(data + 0x64);
+	assert(_start >= 128);
+
+	_varsCount = READ_LE_UINT16(data + 0x2C);
+	_totTextCount = READ_LE_UINT32(data + 0x30);
+	_totResOffset = READ_LE_UINT32(data + 0x34);
+	_totResCount = (_totResOffset == 0xFFFFFFFF) ? 0 : READ_LE_UINT16(data + _totResOffset);
+	_verScript = data[0x29];
+	_verIMEX = data[0x3D];
+	_suffixIM = data[0x3B];
+	_suffixEX = data[0x3C];
+	_animDataSize = READ_LE_UINT16(data + 0x38);
+	_textCenter = READ_LE_UINT16(data + 0x7E);
+}
+
+void Script::funcBlock(int16 retFlag) {
+	FuncParams params;
+	byte cmd;
+	byte cmd2;
+
+	params.retFlag = retFlag;
+
+	skip(1);
+	params.cmdCount = readUint8();
+	skip(2);
+
+	if (params.cmdCount == 0)
+		return;
+
+	params.counter = 0;
+	do {
+		cmd = readUint8();
+		if ((cmd >> 4) >= 12) {
+			cmd2 = 16 - (cmd >> 4);
+			cmd &= 0xF;
+		} else
+			cmd2 = 0;
+
+		params.counter++;
+
+		if (cmd2 == 0)
+			cmd >>= 4;
+
+		funcOpcode(cmd2, cmd, params);
+
+	} while (params.counter != params.cmdCount);
+}
+
+void Script::addFuncOffset(uint32 offset) {
+	for (std::list<uint32>::iterator it = _funcOffsets.begin(); it != _funcOffsets.end(); ++it)
+		if (*it == offset)
+			return;
+
+	_funcOffsets.push_back(offset);
+}
+
+void Script::deGob() {
+	_funcOffsets.clear();
+	_funcOffsets.push_back(_start);
+
+	for (std::list<uint32>::iterator it = _funcOffsets.begin(); it != _funcOffsets.end(); ++it) {
+		seek(*it);
+		deGobFunction();
+		print("\n");
+	}
+}
+
+void Script::deGobFunction() {
+	printIndent();
+	print("sub_%d {\n", getPos());
+	incIndent();
+
+	funcBlock(2);
+
+	decIndent();
+	printIndent();
+	print("}\n");
+}


Property changes on: tools/trunk/degob_script.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: tools/trunk/degob_script.h
===================================================================
--- tools/trunk/degob_script.h	                        (rev 0)
+++ tools/trunk/degob_script.h	2008-08-24 19:01:38 UTC (rev 34120)
@@ -0,0 +1,421 @@
+/* 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$
+ *
+ */
+
+#ifndef DEGOB_SCRIPT_H
+#define DEGOB_SCRIPT_H
+
+#include <string>
+#include <list>
+#include "util.h"
+
+#define _OPCODET(ver, x) TYPE_TEXTDESC, 0, #x
+#define _OPCODEF(ver, x) TYPE_FUNCDESC, &ver::x, #x
+#define _OPCODEB(ver, x) TYPE_BOTHDESC, &ver::x, #x
+
+class ExtTable {
+public:
+	ExtTable(byte *data, uint32 size, byte *dataCom = 0, uint32 sizeCom = 0);
+	~ExtTable();
+
+	byte *getItem(uint16 i, uint32 &size) const;
+
+private:
+	struct Item {
+		int32 offset;
+		uint32 size;
+		uint32 width;
+		uint32 height;
+		bool isPacked;
+	};
+
+	byte *_data;
+	uint32 _size;
+	byte *_dataCom;
+	uint32 _sizeCom;
+
+	uint16 _itemsCount;
+	Item *_items;
+
+	void init();
+	byte *unpack(const byte *packedData, uint32 &size) const;
+};
+
+class Script {
+public:
+	Script(byte *totData, uint32 totSize, ExtTable *extTable = 0);
+	virtual ~Script();
+
+	uint32 getPos() const;
+	void skip(uint32 off);
+	void seek(uint32 off, int whence = SEEK_SET);
+
+	// Properties getter
+	uint16 getStart() const;
+	uint16 getTextCenter() const;
+	uint16 getVarsCount() const;
+	uint32 getTotTextCount() const;
+	uint32 getTotResOffset() const;
+	uint16 getTotResCount() const;
+	uint16 getAnimDataSize() const;
+	uint8 getVerScript() const;
+	uint8 getVerIMEX() const;
+	uint8 getSuffixIM() const;
+	uint8 getSuffixEX() const;
+
+	void deGob();
+
+protected:
+	enum FuncType {
+		TYPE_NONE = 0,   // No description
+		TYPE_TEXTDESC,   // Description by a string
+		TYPE_FUNCDESC,   // Description by a function
+		TYPE_BOTHDESC    // Description by both
+	};
+	enum Param {
+		PARAM_NONE = 0,  // No parameters / Last parameter
+		PARAM_UINT8,     // Immediate uint8
+		PARAM_UINT16,    // Immediate uint16
+		PARAM_UINT32,    // Immediate uint32
+		PARAM_INT8,      // Immediate int8
+		PARAM_INT16,     // Immediate int16
+		PARAM_INT32,     // Immediate int32
+		PARAM_STR,       // Immediate string
+		PARAM_EXPR,      // Expression
+		PARAM_VARINDEX,  // Variable index
+		PARAM_GOB        // Special GobFunc params
+	};
+	struct FuncParams {
+		const char *desc;
+		byte cmdCount;
+		byte counter;
+		int16 retFlag;
+		int16 extraData;
+		int16 objIndex;
+	};
+
+	uint32 _indent;
+
+	virtual void setupOpcodes() = 0;
+	virtual void drawOpcode(byte i, FuncParams &params) = 0;
+	virtual void funcOpcode(byte i, byte j, FuncParams &params) = 0;
+	virtual void goblinOpcode(int i, FuncParams &params) = 0;
+
+	// Helper function for printing
+	void putString(const char *s) const;
+	void print(const char *s, ...) const;
+	void printIndent() const;
+	void printLine(const char *s) const;
+	std::string printStr(const char *s, ...) const;
+
+	void incIndent();
+	void decIndent();
+
+	uint8 readUint8();
+	uint16 readUint16();
+	uint32 readUint32();
+	const char *readString();
+
+	uint8 peekUint8() const;
+	uint16 peekUint16() const;
+	uint32 peekUint32() const;
+	const char *peekString() const;
+
+	void skipExpr(char stopToken = 99);
+	std::string readExpr(char stopToken = 99);
+	std::string readVarIndex();
+
+	uint16 getBlockSize() const;
+
+	void evaluateParams(const Param *params);
+	void printFuncDesc(const FuncParams &fParams, const Param *params);
+	void printFuncDesc(const FuncParams &fParams) const;
+
+	void startFunc(const FuncParams &fParams) const;
+	void endFunc() const;
+
+	void loadProperties(byte *data);
+
+	void funcBlock(int16 retFlag);
+
+	void addFuncOffset(uint32 offset);
+	void deGobFunction();
+
+private:
+	byte *_totData, *_ptr;
+	uint32 _totSize;
+
+protected:
+	ExtTable *_extTable;
+
+	std::list<uint32> _funcOffsets;
+
+	// Script properties
+	uint16 _start, _textCenter;
+	uint16 _varsCount;
+	uint32 _totTextCount;
+	uint32 _totResOffset;
+	uint16 _totResCount;
+	uint16 _animDataSize;
+	uint8 _verScript, _verIMEX;
+	// If > 0, script loads stuff out of commun.exN and commun.imN, where N is this suffix
+	uint8 _suffixIM, _suffixEX;
+};
+
+class Script_v1 : public Script {
+public:
+	Script_v1(byte *totData, uint32 totSize, ExtTable *extTable = 0);
+	virtual ~Script_v1();
+
+protected:
+	typedef void (Script_v1::*OpcodeDrawProcV1)(FuncParams &);
+	typedef void (Script_v1::*OpcodeFuncProcV1)(FuncParams &);
+	typedef void (Script_v1::*OpcodeGoblinProcV1)(FuncParams &);
+	struct OpcodeDrawEntryV1 {
+		FuncType type;
+		OpcodeDrawProcV1 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeFuncEntryV1 {
+		FuncType type;
+		OpcodeFuncProcV1 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeGoblinEntryV1 {
+		FuncType type;
+		OpcodeGoblinProcV1 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	const OpcodeDrawEntryV1 *_opcodesDrawV1;
+	const OpcodeFuncEntryV1 *_opcodesFuncV1;
+	const OpcodeGoblinEntryV1 *_opcodesGoblinV1;
+	static const int _goblinFuncLookUp[][2];
+
+	virtual void setupOpcodes();
+	virtual void drawOpcode(byte i, FuncParams &params);
+	virtual void funcOpcode(byte i, byte j, FuncParams &params);
+	virtual void goblinOpcode(int i, FuncParams &params);
+
+	// Extended opcode functions
+	void o1_drawOperations(FuncParams &params);
+	void o1_goblinFunc(FuncParams &params);
+
+	// Control functions
+	void o1_callSub(FuncParams &params);
+	void o1_switch(FuncParams &params);
+	void o1_repeatUntil(FuncParams &params);
+	void o1_whileDo(FuncParams &params);
+	void o1_if(FuncParams &params);
+	void o1_return(FuncParams &params);
+	void o1_returnTo(FuncParams &params);
+	void o1_setcmdCount(FuncParams &params);
+	void o1_evaluateStore(FuncParams &params);
+
+	void o1_palLoad(FuncParams &params);
+	void o1_loadSpriteToPos(FuncParams &params);
+	void o1_printText(FuncParams &params);
+	void o1_loadTot(FuncParams &params);
+	void o1_loadSound(FuncParams &params);
+
+	void o1_loadMult(FuncParams &params);
+	void o1_loadAnim(FuncParams &params);
+	void o1_loadStatic(FuncParams &params);
+	void o1_loadMultObject(FuncParams &params);
+
+	void o1_dummy(FuncParams &params);
+};
+
+class Script_v2 : public Script_v1 {
+public:
+	Script_v2(byte *totData, uint32 totSize, ExtTable *extTable = 0);
+	virtual ~Script_v2();
+
+protected:
+	typedef void (Script_v2::*OpcodeDrawProcV2)(FuncParams &);
+	typedef void (Script_v2::*OpcodeFuncProcV2)(FuncParams &);
+	typedef void (Script_v2::*OpcodeGoblinProcV2)(FuncParams &);
+	struct OpcodeDrawEntryV2 {
+		FuncType type;
+		OpcodeDrawProcV2 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeFuncEntryV2 {
+		FuncType type;
+		OpcodeFuncProcV2 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeGoblinEntryV2 {
+		FuncType type;
+		OpcodeGoblinProcV2 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	const OpcodeDrawEntryV2 *_opcodesDrawV2;
+	const OpcodeFuncEntryV2 *_opcodesFuncV2;
+	const OpcodeGoblinEntryV2 *_opcodesGoblinV2;
+	static const int _goblinFuncLookUp[][2];
+
+	virtual void setupOpcodes();
+	virtual void drawOpcode(byte i, FuncParams &params);
+	virtual void funcOpcode(byte i, byte j, FuncParams &params);
+	virtual void goblinOpcode(int i, FuncParams &params);
+
+	void o2_goblinFunc(FuncParams &params);
+
+	void o2_totSub(FuncParams &params);
+	void o2_evaluateStore(FuncParams &params);
+	void o2_copyVars(FuncParams &params);
+	void o2_pasteVars(FuncParams &params);
+
+	void o2_loadSound(FuncParams &params);
+
+	void o2_loadMult(FuncParams &params);
+	void o2_loadMultObject(FuncParams &params);
+	void o2_loadMapObjects(FuncParams &params);
+
+	void o2_playMult(FuncParams &params);
+	void o2_printText(FuncParams &params);
+
+	void o2_loadInfogramesIns(FuncParams &params);
+	void o2_playInfogrames(FuncParams &params);
+	void o2_handleGoblins(FuncParams &params);
+};
+
+class Script_Bargon : public Script_v2 {
+public:
+	Script_Bargon(byte *totData, uint32 totSize, ExtTable *extTable = 0);
+	virtual ~Script_Bargon();
+
+protected:
+	typedef void (Script_Bargon::*OpcodeDrawProcBargon)(FuncParams &);
+	typedef void (Script_Bargon::*OpcodeFuncProcBargon)(FuncParams &);
+	typedef void (Script_Bargon::*OpcodeGoblinProcBargon)(FuncParams &);
+	struct OpcodeDrawEntryBargon {
+		FuncType type;
+		OpcodeDrawProcBargon proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeFuncEntryBargon {
+		FuncType type;
+		OpcodeFuncProcBargon proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeGoblinEntryBargon {
+		FuncType type;
+		OpcodeGoblinProcBargon proc;
+		const char *desc;
+		const Param params[16];
+	};
+	const OpcodeDrawEntryBargon *_opcodesDrawBargon;
+	const OpcodeFuncEntryBargon *_opcodesFuncBargon;
+	const OpcodeGoblinEntryBargon *_opcodesGoblinBargon;
+	static const int _goblinFuncLookUp[][2];
+
+	virtual void setupOpcodes();
+	virtual void drawOpcode(byte i, FuncParams &params);
+	virtual void funcOpcode(byte i, byte j, FuncParams &params);
+	virtual void goblinOpcode(int i, FuncParams &params);
+};
+
+class Script_v3 : public Script_v2 {
+public:
+	Script_v3(byte *totData, uint32 totSize, ExtTable *extTable = 0);
+	virtual ~Script_v3();
+
+protected:
+	typedef void (Script_v3::*OpcodeDrawProcV3)(FuncParams &);
+	typedef void (Script_v3::*OpcodeFuncProcV3)(FuncParams &);
+	typedef void (Script_v3::*OpcodeGoblinProcV3)(FuncParams &);
+	struct OpcodeDrawEntryV3 {
+		FuncType type;
+		OpcodeDrawProcV3 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeFuncEntryV3 {
+		FuncType type;
+		OpcodeFuncProcV3 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeGoblinEntryV3 {
+		FuncType type;
+		OpcodeGoblinProcV3 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	const OpcodeDrawEntryV3 *_opcodesDrawV3;
+	const OpcodeFuncEntryV3 *_opcodesFuncV3;
+	const OpcodeGoblinEntryV3 *_opcodesGoblinV3;
+	static const int _goblinFuncLookUp[][2];
+
+	virtual void setupOpcodes();
+	virtual void drawOpcode(byte i, FuncParams &params);
+	virtual void funcOpcode(byte i, byte j, FuncParams &params);
+	virtual void goblinOpcode(int i, FuncParams &params);
+};
+
+class Script_v4 : public Script_v3 {
+public:
+	Script_v4(byte *totData, uint32 totSize, ExtTable *extTable = 0);
+	virtual ~Script_v4();
+
+protected:
+	typedef void (Script_v4::*OpcodeDrawProcV4)(FuncParams &);
+	typedef void (Script_v4::*OpcodeFuncProcV4)(FuncParams &);
+	typedef void (Script_v4::*OpcodeGoblinProcV4)(FuncParams &);
+	struct OpcodeDrawEntryV4 {
+		FuncType type;
+		OpcodeDrawProcV4 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeFuncEntryV4 {
+		FuncType type;
+		OpcodeFuncProcV4 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	struct OpcodeGoblinEntryV4 {
+		FuncType type;
+		OpcodeGoblinProcV4 proc;
+		const char *desc;
+		const Param params[16];
+	};
+	const OpcodeDrawEntryV4 *_opcodesDrawV4;
+	const OpcodeFuncEntryV4 *_opcodesFuncV4;
+	const OpcodeGoblinEntryV4 *_opcodesGoblinV4;
+	static const int _goblinFuncLookUp[][2];
+
+	virtual void setupOpcodes();
+	virtual void drawOpcode(byte i, FuncParams &params);
+	virtual void funcOpcode(byte i, byte j, FuncParams &params);
+	virtual void goblinOpcode(int i, FuncParams &params);
+};
+
+#endif // DEGOB_SCRIPT_H


Property changes on: tools/trunk/degob_script.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: tools/trunk/degob_script_bargon.cpp
===================================================================
--- tools/trunk/degob_script_bargon.cpp	                        (rev 0)
+++ tools/trunk/degob_script_bargon.cpp	2008-08-24 19:01:38 UTC (rev 34120)
@@ -0,0 +1,697 @@
+/* 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"
+
+#define OPCODET(x) _OPCODET(Script_Bargon, x)
+#define OPCODEF(x) _OPCODEF(Script_Bargon, x)
+#define OPCODEB(x) _OPCODEB(Script_Bargon, x)
+
+const int Script_Bargon::_goblinFuncLookUp[][2] = {
+	{1, 0},
+	{2, 1},
+	{3, 2},
+	{4, 3},
+	{5, 4},
+	{6, 5},
+	{7, 6},
+	{8, 7},
+	{9, 8},
+	{10, 9},
+	{11, 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},
+	{100, 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}
+};
+
+Script_Bargon::Script_Bargon(byte *totData, uint32 totSize, ExtTable *extTable) :
+	Script_v2(totData, totSize, extTable) {
+
+	setupOpcodes();
+}
+
+Script_Bargon::~Script_Bargon() {
+}
+
+void Script_Bargon::setupOpcodes() {
+	static const OpcodeDrawEntryBargon opcodesDraw[256] = {
+		/* 00 */
+		{OPCODEF(o2_loadMult), {PARAM_NONE}},
+		{OPCODEF(o2_playMult), {PARAM_NONE}},
+		{OPCODET(o2_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(o2_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}},
+		{OPCODET(o2_multSub), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		/* 14 */
+		{OPCODET(o2_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(o2_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(o2_renderStatic), {PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_loadCurLayer), {PARAM_EXPR, PARAM_EXPR}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		/* 20 */
+		{OPCODET(o2_playCDTrack), {PARAM_EXPR}},
+		{OPCODET(o2_waitCDTrackEnd), {PARAM_NONE}},
+		{OPCODET(o2_stopCD), {PARAM_NONE}},
+		{OPCODET(o2_readLIC), {PARAM_EXPR}},
+		/* 24 */
+		{OPCODET(o2_freeLIC), {PARAM_NONE}},
+		{OPCODET(o2_getCDTrackPos), {PARAM_VARINDEX, PARAM_VARINDEX}},
+		{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(o2_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 */
+		{OPCODEF(o2_totSub), {PARAM_NONE}},
+		{OPCODET(o2_switchTotSub), {PARAM_UINT16, PARAM_UINT16}},
+		{OPCODEF(o2_copyVars), {PARAM_NONE}},
+		{OPCODEF(o2_pasteVars), {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 */
+		{OPCODEF(o2_loadMapObjects), {PARAM_NONE}},
+		{OPCODET(o2_freeGoblins), {PARAM_NONE}},
+		{OPCODET(o2_moveGoblin), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_writeGoblinPos), {PARAM_VARINDEX, PARAM_VARINDEX, PARAM_EXPR}},
+		/* 54 */
+		{OPCODET(o2_stopGoblin), {PARAM_EXPR}},
+		{OPCODET(o2_setGoblinState), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_placeGoblin), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		{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 */
+		{OPCODET(o2_initScreen), {PARAM_UINT8, PARAM_UINT8, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_scroll), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_setScrollOffset), {PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_playImd), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		/* 84 */
+		{OPCODET(o2_getImdInfo), {PARAM_EXPR, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX}},
+		{OPCODET(o2_openItk), {PARAM_EXPR}},
+		{OPCODET(o2_closeItk), {PARAM_NONE}},
+		{OPCODET(o2_setImdFrontSurf), {PARAM_NONE}},
+		/* 88 */
+		{OPCODET(o2_resetImdFrontSurf), {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 OpcodeFuncEntryBargon 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(o2_evaluateStore), {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(o2_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(o2_animPalInit), {PARAM_INT16, PARAM_EXPR, PARAM_EXPR}},
+		/* 18 */
+		{OPCODET(o2_addCollision), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_UINT16}},
+		{OPCODET(o2_freeCollision), {PARAM_EXPR}},
+		{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(o2_goblinFunc), {PARAM_NONE}},
+		{OPCODET(o2_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(o2_stopSound), {PARAM_EXPR}},
+		{OPCODEF(o2_loadSound), {PARAM_NONE}},
+		{OPCODET(o1_freeSoundSlot), {PARAM_EXPR}},
+		/* 3C */
+		{OPCODET(o1_waitEndPlay), {PARAM_NONE}},
+		{OPCODET(o1_playComposition), {PARAM_VARINDEX, PARAM_EXPR}},
+		{OPCODET(o2_getFreeMem), {PARAM_VARINDEX, PARAM_VARINDEX}},
+		{OPCODET(o2_checkData), {PARAM_EXPR, PARAM_VARINDEX}},
+		/* 40 */
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{OPCODET(o1_prepareStr), {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(o2_readData), {PARAM_EXPR, PARAM_VARINDEX, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_writeData), {PARAM_EXPR, PARAM_VARINDEX, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o1_manageDataFile), {PARAM_EXPR}},
+	};
+
+	static const OpcodeGoblinEntryBargon opcodesGoblin[73] = {
+		/* 00 */
+		{OPCODET(oBargon_intro0), {PARAM_NONE}},
+		{OPCODET(oBargon_intro1), {PARAM_NONE}},
+		{OPCODET(oBargon_intro2), {PARAM_NONE}},
+		{OPCODET(oBargon_intro3), {PARAM_NONE}},
+		/* 04 */
+		{OPCODET(oBargon_intro4), {PARAM_NONE}},
+		{OPCODET(oBargon_intro5), {PARAM_NONE}},
+		{OPCODET(oBargon_intro6), {PARAM_NONE}},
+		{OPCODET(oBargon_intro7), {PARAM_NONE}},
+		/* 08 */
+		{OPCODET(oBargon_intro8), {PARAM_NONE}},
+		{OPCODET(oBargon_intro9), {PARAM_NONE}},
+		{OPCODET(oBargon_NOP), {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}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		/* 14 */
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		/* 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}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		/* 20 */
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {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 */
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{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}},
+		{OPCODEF(o1_dummy), {PARAM_NONE}}
+	};
+
+	_opcodesDrawBargon = opcodesDraw;
+	_opcodesFuncBargon = opcodesFunc;
+	_opcodesGoblinBargon = opcodesGoblin;
+}
+
+void Script_Bargon::drawOpcode(byte i, FuncParams &params) {
+	FuncType type = _opcodesDrawBargon[i].type;
+	params.desc = _opcodesDrawBargon[i].desc;
+	OpcodeDrawProcBargon op = _opcodesDrawBargon[i].proc;
+
+	if (type == TYPE_NONE)
+		error("No such opcodeDraw: %d", i);
+	if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC))
+		printFuncDesc(params, _opcodesDrawBargon[i].params);
+	if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+		(this->*op)(params);
+}
+
+void Script_Bargon::funcOpcode(byte i, byte j, FuncParams &params) {
+	int n = i*16 + j;
+	FuncType type = TYPE_NONE;
+	OpcodeFuncProcBargon op = 0;
+
+	if ((i <= 4) && (j <= 15)) {
+		op = _opcodesFuncBargon[n].proc;
+		params.desc = _opcodesFuncBargon[n].desc;
+		type = _opcodesFuncBargon[n].type;
+	}
+
+	if (type == TYPE_NONE)
+		error("No such opcodeFunc: %d.%d", i, j);
+	if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC))
+		printFuncDesc(params, _opcodesFuncBargon[n].params);
+	if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+		(this->*op)(params);
+}
+
+void Script_Bargon::goblinOpcode(int i, FuncParams &params) {
+	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;
+	OpcodeGoblinProcBargon op = 0;
+
+	if (n >= 0) {
+		op = _opcodesGoblinBargon[n].proc;
+		params.desc = _opcodesGoblinBargon[n].desc;
+		type = _opcodesGoblinBargon[n].type;
+	}
+
+	if (type == TYPE_NONE)
+		error("No such opcodeGoblin: %d (%d)", i, n);
+	if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC)) {
+		const Param *param = _opcodesGoblinBargon[n].params;
+		if (*param == PARAM_GOB)
+			printFuncDesc(params);
+		else
+			printFuncDesc(params, param);
+	}
+	if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+		(this->*op)(params);
+}


Property changes on: tools/trunk/degob_script_bargon.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: tools/trunk/degob_script_v1.cpp
===================================================================
--- tools/trunk/degob_script_v1.cpp	                        (rev 0)
+++ tools/trunk/degob_script_v1.cpp	2008-08-24 19:01:38 UTC (rev 34120)
@@ -0,0 +1,1140 @@
+/* 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"
+
+#define OPCODET(x) _OPCODET(Script_v1, x)
+#define OPCODEF(x) _OPCODEF(Script_v1, x)
+#define OPCODEB(x) _OPCODEB(Script_v1, x)
+
+const int Script_v1::_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_v1::Script_v1(byte *totData, uint32 totSize, ExtTable *extTable) :
+	Script(totData, totSize, extTable) {
+
+	setupOpcodes();
+}
+
+Script_v1::~Script_v1() {
+}
+
+void Script_v1::setupOpcodes() {
+	static const OpcodeDrawEntryV1 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 OpcodeFuncEntryV1 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_evaluateStore), {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}},
+		{OPCODEF(o1_loadSound), {PARAM_NONE}},
+		{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_prepareStr), {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 OpcodeGoblinEntryV1 opcodesGoblin[73] = {
+		/* 00 */
+		{OPCODET(o1_setState), {PARAM_GOB}},
+		{OPCODET(o1_setCurFrame), {PARAM_GOB}},
+		{OPCODET(o1_setNextState), {PARAM_GOB}},
+		{OPCODET(o1_setMultState), {PARAM_GOB}},
+		/* 04 */
+		{OPCODET(o1_setOrder), {PARAM_GOB}},
+		{OPCODET(o1_setActionStartState), {PARAM_GOB}},
+		{OPCODET(o1_setCurLookDir), {PARAM_GOB}},
+		{OPCODET(o1_setType), {PARAM_GOB}},
+		/* 08 */
+		{OPCODET(o1_setNoTick), {PARAM_GOB}},
+		{OPCODET(o1_setPickable), {PARAM_GOB}},
+		{OPCODET(o1_setXPos), {PARAM_GOB}},
+		{OPCODET(o1_setYPos), {PARAM_GOB}},
+		/* 0C */
+		{OPCODET(o1_setDoAnim), {PARAM_GOB}},
+		{OPCODET(o1_setRelaxTime), {PARAM_GOB}},
+		{OPCODET(o1_setMaxTick), {PARAM_GOB}},
+		{OPCODET(o1_getState), {PARAM_GOB}},
+		/* 10 */
+		{OPCODET(o1_getCurFrame), {PARAM_GOB}},
+		{OPCODET(o1_getNextState), {PARAM_GOB}},
+		{OPCODET(o1_getMultState), {PARAM_GOB}},
+		{OPCODET(o1_getOrder), {PARAM_GOB}},
+		/* 14 */
+		{OPCODET(o1_getActionStartState), {PARAM_GOB}},
+		{OPCODET(o1_getCurLookDir), {PARAM_GOB}},
+		{OPCODET(o1_getType), {PARAM_GOB}},
+		{OPCODET(o1_getNoTick), {PARAM_GOB}},
+		/* 18 */
+		{OPCODET(o1_getPickable), {PARAM_GOB}},
+		{OPCODET(o1_getObjMaxFrame), {PARAM_GOB}},
+		{OPCODET(o1_getXPos), {PARAM_GOB}},
+		{OPCODET(o1_getYPos), {PARAM_GOB}},
+		/* 1C */
+		{OPCODET(o1_getDoAnim), {PARAM_GOB}},
+		{OPCODET(o1_getRelaxTime), {PARAM_GOB}},
+		{OPCODET(o1_getMaxTick), {PARAM_GOB}},
+		{OPCODET(o1_manipulateMap), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+		/* 20 */
+		{OPCODET(o1_getItem), {PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_manipulateMapIndirect), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_getItemIndirect), {PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_setPassMap), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+		/* 24 */
+		{OPCODET(o1_setGoblinPosH), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_getGoblinPosXH), {PARAM_INT16}},
+		{OPCODET(o1_getGoblinPosYH), {PARAM_INT16}},
+		{OPCODET(o1_setGoblinMultState), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+		/* 28 */
+		{OPCODET(o1_setGoblinUnk14), {PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_setItemIdInPocket), {PARAM_INT16}},
+		{OPCODET(o1_setItemIndInPocket), {PARAM_INT16}},
+		{OPCODET(o1_getItemIdInPocket), {PARAM_NONE}},
+		/* 2C */
+		{OPCODET(o1_getItemIndInPocket), {PARAM_NONE}},
+		{OPCODET(o1_setItemPos), {PARAM_NONE}},
+		{OPCODET(o1_setGoblinPos), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_setGoblinState), {PARAM_INT16, PARAM_INT16}},
+		/* 30 */
+		{OPCODET(o1_setGoblinStateRedraw), {PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_decRelaxTime), {PARAM_INT16}},
+		{OPCODET(o1_getGoblinPosX), {PARAM_INT16}},
+		{OPCODET(o1_getGoblinPosY), {PARAM_INT16}},
+		/* 34 */
+		{OPCODET(o1_clearPathExistence), {PARAM_NONE}},
+		{OPCODET(o1_setGoblinVisible), {PARAM_INT16}},
+		{OPCODET(o1_setGoblinInvisible), {PARAM_INT16}},
+		{OPCODET(o1_getObjectIntersect), {PARAM_INT16, PARAM_INT16}},
+		/* 38 */
+		{OPCODET(o1_getGoblinIntersect), {PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_setItemPos), {PARAM_INT16, PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_loadObjects), {PARAM_INT16}},
+		{OPCODET(o1_freeObjects), {PARAM_NONE}},
+		/* 3C */
+		{OPCODET(o1_animateObjects), {PARAM_NONE}},
+		{OPCODET(o1_drawObjects), {PARAM_NONE}},
+		{OPCODET(o1_loadMap), {PARAM_NONE}},
+		{OPCODET(o1_moveGoblin), {PARAM_INT16, PARAM_INT16}},
+		/* 40 */
+		{OPCODET(o1_switchGoblin), {PARAM_NONE}},
+		{OPCODET(o1_loadGoblin), {PARAM_NONE}},
+		{OPCODET(o1_writeTreatItem), {PARAM_INT16, PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_moveGoblin0), {PARAM_NONE}},
+		/* 44 */
+		{OPCODET(o1_setGoblinTarget), {PARAM_INT16}},
+		{OPCODET(o1_setGoblinObjectsPos), {PARAM_INT16, PARAM_INT16}},
+		{OPCODET(o1_initGoblin), {PARAM_NONE}},
+		{OPCODEF(o1_dummy), {PARAM_NONE}}
+	};
+
+	_opcodesDrawV1 = opcodesDraw;
+	_opcodesFuncV1 = opcodesFunc;
+	_opcodesGoblinV1 = opcodesGoblin;
+}
+
+void Script_v1::drawOpcode(byte i, FuncParams &params) {
+	FuncType type = _opcodesDrawV1[i].type;
+	params.desc = _opcodesDrawV1[i].desc;
+	OpcodeDrawProcV1 op = _opcodesDrawV1[i].proc;
+
+	if (type == TYPE_NONE)
+		error("No such opcodeDraw: %d", i);
+	if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC))
+		printFuncDesc(params, _opcodesDrawV1[i].params);
+	if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+		(this->*op)(params);
+}
+
+void Script_v1::funcOpcode(byte i, byte j, FuncParams &params) {
+	int n = i*16 + j;
+	FuncType type = TYPE_NONE;
+	OpcodeFuncProcV1 op = 0;
+
+	if ((i <= 4) && (j <= 15)) {
+		op = _opcodesFuncV1[n].proc;
+		params.desc = _opcodesFuncV1[n].desc;
+		type = _opcodesFuncV1[n].type;
+	}
+
+	if (type == TYPE_NONE)
+		error("No such opcodeFunc: %d.%d", i, j);
+	if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC))
+		printFuncDesc(params, _opcodesFuncV1[n].params);
+	if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+		(this->*op)(params);
+}
+
+void Script_v1::goblinOpcode(int i, FuncParams &params) {
+	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;
+	OpcodeGoblinProcV1 op = 0;
+
+	if (n >= 0) {
+		op = _opcodesGoblinV1[n].proc;
+		params.desc = _opcodesGoblinV1[n].desc;
+		type = _opcodesGoblinV1[n].type;
+	}
+
+	if (type == TYPE_NONE)
+		error("No such opcodeGoblin: %d (%d)", i, n);
+	if ((type == TYPE_TEXTDESC) || (type == TYPE_BOTHDESC)) {
+		const Param *param = _opcodesGoblinV1[n].params;
+		if (*param == PARAM_GOB)
+			printFuncDesc(params);
+		else
+			printFuncDesc(params, param);
+	}
+	if ((type == TYPE_FUNCDESC) || (type == TYPE_BOTHDESC))
+		(this->*op)(params);
+}
+
+void Script_v1::o1_drawOperations(FuncParams &params) {
+	drawOpcode(readUint8(), params);
+}
+
+void Script_v1::o1_goblinFunc(FuncParams &params) {
+	FuncParams gobParams;
+	bool objDescSet = false;
+	int16 cmd;
+
+	gobParams.extraData = 0;
+	gobParams.objIndex = -1;
+
+	cmd = (int16) readUint16();
+	skip(2);
+
+	if ((cmd > 0) && (cmd < 17)) {
+		objDescSet = true;
+		gobParams.objIndex = (int16) readUint16();
+		gobParams.extraData = (int16) readUint16();
+	}
+
+	if ((cmd > 90) && (cmd < 107)) {
+		objDescSet = true;
+		gobParams.objIndex = (int16) readUint16();
+		gobParams.extraData = (int16) readUint16();
+		cmd -= 90;
+	}
+
+	if ((cmd > 110) && (cmd < 128)) {
+		objDescSet = true;
+		gobParams.objIndex = (int16) readUint16();
+		cmd -= 90;
+	} else if ((cmd > 20) && (cmd < 38)) {
+		objDescSet = true;
+		gobParams.objIndex = (int16) readUint16();
+	}
+
+	goblinOpcode(cmd, gobParams);
+}
+
+void Script_v1::o1_callSub(FuncParams &params) {
+	uint16 offset = readUint16();
+
+	if (offset < 128)
+		error("o1_callSub: Offset %d points into the header", offset);
+
+	printIndent();
+
+	uint32 pos = getPos();
+
+	seek(offset);
+
+	if (peekUint8() == 1) {
+		print("sub_%d();\n", offset);
+		addFuncOffset(offset);
+	} else if (peekUint8() == 2)
+		print("o1_collisionsBlock(%d);\n", offset);
+	else
+		error("Unknown block type %d (%d)", peekUint8(), offset);
+
+	seek(pos);
+}
+
+void Script_v1::o1_switch(FuncParams &params) {
+	uint32 nextPos;
+	int16 len;
+
+	printIndent();
+	print("switch (%s) {\n", readVarIndex().c_str());
+
+	len = (int8) readUint8();
+	while (len != -5) {
+		for (int16 i = 0; i < len; i++) {
+			printIndent();
+			print("case %s:\n", readExpr().c_str());
+		}
+
+		incIndent();
+
+		nextPos = getPos() + getBlockSize();
+
+		funcBlock(0);
+
+		seek(nextPos);
+
+		printIndent();
+		print("break;\n");
+
+		decIndent();
+
+		len = (int8) readUint8();
+	}
+
+	if ((peekUint8() >> 4) == 4) {
+		printIndent();
+		print("default:\n");
+		incIndent();
+
+		skip(1);
+		nextPos = getPos() + getBlockSize();
+
+		funcBlock(0);
+
+		seek(nextPos);
+
+		printIndent();
+		print("break;\n");
+
+		decIndent();
+	}
+
+	printIndent();
+	print("}\n");
+}
+
+void Script_v1::o1_repeatUntil(FuncParams &params) {
+	uint32 nextPos = getPos() + getBlockSize() + 1;
+
+	printIndent();
+	print("repeat {\n");
+	incIndent();
+
+	funcBlock(1);
+
+	seek(nextPos);
+
+	decIndent();
+	printIndent();
+	print("} until (%s);\n", readExpr().c_str());
+}
+
+void Script_v1::o1_whileDo(FuncParams &params) {
+	printIndent();
+	print("while (%s) {\n", readExpr().c_str());
+	incIndent();
+
+	uint32 nextPos = getPos() + getBlockSize();
+
+	funcBlock(1);
+
+	seek(nextPos);
+
+	decIndent();
+	printIndent();
+	print("}\n");
+}
+
+void Script_v1::o1_if(FuncParams &params) {
+	printIndent();
+	print("if (%s) {\n", readExpr().c_str());
+	incIndent();
+
+	uint32 nextPos = getPos() + getBlockSize();
+
+	funcBlock(0);
+
+	seek(nextPos);
+
+	if ((readUint8() >> 4) == 12) {
+		decIndent();
+		printIndent();
+		print("} else {\n");
+		incIndent();
+
+		nextPos = getPos() + getBlockSize();
+
+		funcBlock(0);
+
+		seek(nextPos);
+	}
+
+	decIndent();
+	printIndent();
+	print("}\n");
+}
+
+void Script_v1::o1_return(FuncParams &params) {
+	printIndent();
+	print("return;\n");
+}
+
+void Script_v1::o1_returnTo(FuncParams &params) {
+	printIndent();
+	print("return;\n");
+}
+
+void Script_v1::o1_setcmdCount(FuncParams &params) {
+	params.cmdCount = readUint8();
+	params.counter = 0;
+}
+
+void Script_v1::o1_evaluateStore(FuncParams &params) {
+	printIndent();
+	std::string varIndex = readVarIndex();
+	std::string expr = readExpr();
+
+	print("%s = %s;\n", varIndex.c_str(), expr.c_str());
+}
+
+void Script_v1::o1_palLoad(FuncParams &params) {
+	byte cmd = readUint8();
+
+	startFunc(params);
+	print("%d, %d", (cmd & 0x80) != 0, cmd & 0x7F);
+	endFunc();
+
+	switch (cmd & 0x7F) {
+	case 48:
+		skip(48);
+		break;
+
+	case 49:
+		skip(18);
+		break;
+
+	case 50:
+		skip(16);
+		break;
+
+	case 51:
+		skip(2);
+		break;
+
+	case 52:
+		skip(48);
+		break;
+
+	case 53:
+		skip(2);
+		break;
+
+	case 61:
+		skip(4);
+		break;
+	}
+}
+
+void Script_v1::o1_loadSpriteToPos(FuncParams &params) {
+	startFunc(params);
+	print("%d, ", (int16) readUint16());
+	print("%s, ", readExpr().c_str());
+	print("%s, ", readExpr().c_str());
+	uint8 tDest = readUint8();
+	print("%d, %d", tDest & 1, ((int8) (tDest >> 1)) - 1);
+	endFunc();
+
+	skip(1);
+}
+
+void Script_v1::o1_printText(FuncParams &params) {
+	startFunc(params);
+	print("%s, ", readExpr().c_str());
+	print("%s, ", readExpr().c_str());
+	print("%s, ", readExpr().c_str());
+	print("%s, ", readExpr().c_str());
+	print("%s", readExpr().c_str());
+
+	do {
+		print(", \"");
+		for (int i = 0; (((char) (peekUint8())) != '.') && (peekUint8() != 200); i++)
+			print("%c", (char) readUint8());
+
+		if (peekUint8() != 200) {
+			skip(1);
+
+			print("\", ");
+			switch (peekUint8()) {
+			case 16:
+			case 17:
+			case 18:
+			case 23:
+			case 24:
+			case 25:
+			case 26:
+			case 27:
+			case 28:
+				print("%s", readVarIndex().c_str());
+				break;
+			}
+			skip(1);
+		} else
+			print("\"");
+
+	} while (peekUint8() != 200);
+
+	endFunc();
+
+	skip(1);
+}
+
+void Script_v1::o1_loadTot(FuncParams &params) {
+	startFunc(params);
+
+	int8 size = (int8) readUint8();
+	if ((size & 0x80) == 0) {
+		for (int i = 0; i < size; i++)
+			print("%c", (char) readUint8());
+	} else
+		print("%s", readExpr().c_str());
+	print(".tot");
+
+	endFunc();
+}
+
+void Script_v1::o1_loadSound(FuncParams &params) {
+	int16 id;
+
+	startFunc(params);
+	print("%s, ", readExpr().c_str());
+	id = readUint16();
+	print("%d", id);
+	if (id == -1) {
+		print(", %s", peekString());
+		skip(9);
+	}
+	endFunc();
+}
+
+void Script_v1::o1_loadMult(FuncParams &params) {
+	uint16 id = readUint16();
+
+	startFunc(params);
+	print("%d", id);
+	endFunc();
+
+	if (!_extTable)
+		error("EXT file needed");
+
+	uint32 size;
+	byte *extData = _extTable->getItem(id - 30000, size);
+	byte *data = extData;
+
+	int32 count1, count2;
+
+	count1 = ((int8) data[0]) + 1;
+	count2 = ((int8) data[1]) + 1;
+	data += 2;
+	// Statics
+	for (int i = 0; i < count1; i++, data += 14) {
+		int16 sSize;
+		
+		readExpr();
+		sSize = (int16) readUint16();
+		skip(sSize * 2);
+		sSize = (int16) readUint16();
+		skip(2 + sSize * 8);
+	}
+	// Anims
+	for (int i = 0; i < count2; i++, data += 14) {
+		readExpr();
+		int16 sSize = (int16) readUint16();
+		skip(2 + sSize * 8);
+	}
+
+	// FPS
+	data += 2;
+
+	// StaticKeys
+	count1 = (int16) READ_LE_UINT16(data);
+	data += 2 + count1 * 4;
+
+	// AnimKeys
+	for (int i = 0; i < 4; i++) {
+		count1 = (int16) READ_LE_UINT16(data);
+		data += 2 + count1 * 10;
+	}
+
+	// fadePal
+	data += 5 * 16 * 3;
+
+	// palFadeKeys
+	count1 = (int16) READ_LE_UINT16(data);
+	data += 2 + count1 * 7;
+
+	// palKeys
+	count1 = (int16) READ_LE_UINT16(data);
+	data += 2 + count1 * 80;
+
+	// textKeys
+	count1 = (int16) READ_LE_UINT16(data);
+	data += 2 + count1 * 28;
+
+	// soundKeys
+	count1 = (int16) READ_LE_UINT16(data);
+	data += 2;
+	for (int i = 0; i < count1; i++, data += 36) {
+		int16 cmd = (int16) READ_LE_UINT16(data + 2);
+
+		if ((cmd == 1) || (cmd == 4))
+			skip(2);
+		else if (cmd == 3)
+			skip(6);
+		else if (cmd == 5)
+			skip(((int16) READ_LE_UINT16(data + 4)) * 2);
+	}
+
+	delete[] extData;
+}
+
+void Script_v1::o1_loadAnim(FuncParams &params) {
+	int16 sSize;
+
+	startFunc(params);
+	print("%s, ", readExpr().c_str());
+	sSize = (int16) readUint16();
+	print("%d, %d", sSize, readUint16());
+	endFunc();
+
+	skip(sSize * 8);
+}
+
+void Script_v1::o1_loadStatic(FuncParams &params) {
+	int16 sSize1, sSize2;
+
+	startFunc(params);
+	print("%s, ", readExpr().c_str());
+	sSize1 = (int16) readUint16();
+	skip(sSize1 * 2);
+	sSize2 = (int16) readUint16();
+	print("%d, %d, %d", sSize1, sSize2, readUint16());
+	endFunc();
+
+	skip(sSize2 * 8);
+}
+
+void Script_v1::o1_loadMultObject(FuncParams &params) {
+	startFunc(params);
+	print("%s, ", readExpr().c_str());
+	print("%s, ", readExpr().c_str());
+	print("%s", readExpr().c_str());
+	endFunc();
+
+	for (int i = 0; i < 11; i++)
+		readExpr();
+}
+
+void Script_v1::o1_dummy(FuncParams &params) {
+	seek((uint32) -2, SEEK_CUR);
+	uint16 size = readUint16();
+	skip(size * 2);
+}


Property changes on: tools/trunk/degob_script_v1.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: tools/trunk/degob_script_v2.cpp
===================================================================
--- tools/trunk/degob_script_v2.cpp	                        (rev 0)
+++ tools/trunk/degob_script_v2.cpp	2008-08-24 19:01:38 UTC (rev 34120)
@@ -0,0 +1,934 @@
+/* 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"
+
+#define OPCODET(x) _OPCODET(Script_v2, x)
+#define OPCODEF(x) _OPCODEF(Script_v2, x)
+#define OPCODEB(x) _OPCODEB(Script_v2, x)
+
+const int Script_v2::_goblinFuncLookUp[][2] = {
+	{0, 0},
+	{1, 1},
+	{2, 2},
+	{4, 3},
+	{5, 4},
+	{6, 5},
+	{7, 6},
+	{8, 7},
+	{9, 8},
+	{10, 9},
+	{12, 10},
+	{13, 71},
+	{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},
+	{100, 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},
+	{3, 71}
+};
+
+Script_v2::Script_v2(byte *totData, uint32 totSize, ExtTable *extTable) :
+	Script_v1(totData, totSize, extTable) {
+
+	setupOpcodes();
+}
+
+Script_v2::~Script_v2() {
+}
+
+void Script_v2::setupOpcodes() {
+	static const OpcodeDrawEntryV2 opcodesDraw[256] = {
+		/* 00 */
+		{OPCODEF(o2_loadMult), {PARAM_NONE}},
+		{OPCODEF(o2_playMult), {PARAM_NONE}},
+		{OPCODET(o2_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(o2_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}},
+		{OPCODET(o2_multSub), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		/* 14 */
+		{OPCODET(o2_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(o2_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(o2_renderStatic), {PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_loadCurLayer), {PARAM_EXPR, PARAM_EXPR}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		{TYPE_NONE, 0, 0, {PARAM_NONE}},
+		/* 20 */
+		{OPCODET(o2_playCDTrack), {PARAM_EXPR}},
+		{OPCODET(o2_waitCDTrackEnd), {PARAM_NONE}},
+		{OPCODET(o2_stopCD), {PARAM_NONE}},
+		{OPCODET(o2_readLIC), {PARAM_EXPR}},
+		/* 24 */
+		{OPCODET(o2_freeLIC), {PARAM_NONE}},
+		{OPCODET(o2_getCDTrackPos), {PARAM_VARINDEX, PARAM_VARINDEX}},
+		{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(o2_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 */
+		{OPCODEF(o2_totSub), {PARAM_NONE}},
+		{OPCODET(o2_switchTotSub), {PARAM_UINT16, PARAM_UINT16}},
+		{OPCODEF(o2_copyVars), {PARAM_NONE}},
+		{OPCODEF(o2_pasteVars), {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 */
+		{OPCODEF(o2_loadMapObjects), {PARAM_NONE}},
+		{OPCODET(o2_freeGoblins), {PARAM_NONE}},
+		{OPCODET(o2_moveGoblin), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_writeGoblinPos), {PARAM_VARINDEX, PARAM_VARINDEX, PARAM_EXPR}},
+		/* 54 */
+		{OPCODET(o2_stopGoblin), {PARAM_EXPR}},
+		{OPCODET(o2_setGoblinState), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_placeGoblin), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		{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 */
+		{OPCODET(o2_initScreen), {PARAM_UINT8, PARAM_UINT8, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_scroll), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_setScrollOffset), {PARAM_EXPR, PARAM_EXPR}},
+		{OPCODET(o2_playImd), {PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR, PARAM_EXPR}},
+		/* 84 */
+		{OPCODET(o2_getImdInfo), {PARAM_EXPR, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX, PARAM_VARINDEX}},
+		{OPCODET(o2_openItk), {PARAM_EXPR}},
+		{OPCODET(o2_closeItk), {PARAM_NONE}},
+		{OPCODET(o2_setImdFrontSurf), {PARAM_NONE}},
+		/* 88 */
+		{OPCODET(o2_resetImdFrontSurf), {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}},

@@ Diff output truncated at 100000 characters. @@

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