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

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Thu Sep 24 05:41:45 CEST 2009


Revision: 44285
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44285&view=rev
Author:   Kirben
Date:     2009-09-24 03:41:45 +0000 (Thu, 24 Sep 2009)

Log Message:
-----------
Split the script opcode table for DIMP, since it doesn't match(ie timers) other Puzzle Pack games.

Modified Paths:
--------------
    scummvm/trunk/dists/msvc8/agos.vcproj
    scummvm/trunk/dists/msvc9/agos.vcproj
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/detection.cpp
    scummvm/trunk/engines/agos/event.cpp
    scummvm/trunk/engines/agos/module.mk
    scummvm/trunk/engines/agos/script_pp.cpp

Added Paths:
-----------
    scummvm/trunk/engines/agos/script_dp.cpp

Modified: scummvm/trunk/dists/msvc8/agos.vcproj
===================================================================
--- scummvm/trunk/dists/msvc8/agos.vcproj	2009-09-24 02:56:37 UTC (rev 44284)
+++ scummvm/trunk/dists/msvc8/agos.vcproj	2009-09-24 03:41:45 UTC (rev 44285)
@@ -50,6 +50,7 @@
 		<File RelativePath="..\..\engines\agos\rooms.cpp" />
 		<File RelativePath="..\..\engines\agos\saveload.cpp" />
 		<File RelativePath="..\..\engines\agos\script.cpp" />
+		<File RelativePath="..\..\engines\agos\script_dp.cpp" />
 		<File RelativePath="..\..\engines\agos\script_e1.cpp" />
 		<File RelativePath="..\..\engines\agos\script_e2.cpp" />
 		<File RelativePath="..\..\engines\agos\script_ff.cpp" />

Modified: scummvm/trunk/dists/msvc9/agos.vcproj
===================================================================
--- scummvm/trunk/dists/msvc9/agos.vcproj	2009-09-24 02:56:37 UTC (rev 44284)
+++ scummvm/trunk/dists/msvc9/agos.vcproj	2009-09-24 03:41:45 UTC (rev 44285)
@@ -51,6 +51,7 @@
 		<File RelativePath="..\..\engines\agos\rooms.cpp" />
 		<File RelativePath="..\..\engines\agos\saveload.cpp" />
 		<File RelativePath="..\..\engines\agos\script.cpp" />
+		<File RelativePath="..\..\engines\agos\script_dp.cpp" />
 		<File RelativePath="..\..\engines\agos\script_e1.cpp" />
 		<File RelativePath="..\..\engines\agos\script_e2.cpp" />
 		<File RelativePath="..\..\engines\agos\script_ff.cpp" />

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2009-09-24 02:56:37 UTC (rev 44284)
+++ scummvm/trunk/engines/agos/agos.cpp	2009-09-24 03:41:45 UTC (rev 44285)
@@ -60,19 +60,23 @@
 };
 
 #ifdef ENABLE_AGOS2
-AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system)
-	: AGOSEngine_Feeble(system) {
+AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system)
+	: AGOSEngine_PuzzlePack(system) {
 
-	_oopsValid = false;
 	_iconToggleCount = 0;
 	_voiceCount = 0;
 
-	_gameTime = 0;
 	_lastTickCount = 0;
-	_thisTickCount = 0;
 	_startSecondCount = 0;
 	_tSecondCount = 0;
 }
+
+AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system)
+	: AGOSEngine_Feeble(system) {
+
+	_oopsValid = false;
+	_gameTime = 0;
+}
 #endif
 
 AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system)

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2009-09-24 02:56:37 UTC (rev 44284)
+++ scummvm/trunk/engines/agos/agos.h	2009-09-24 03:41:45 UTC (rev 44285)
@@ -2070,10 +2070,7 @@
 	const OpcodeEntryPuzzlePack *_opcodesPuzzlePack;
 
 	bool _oopsValid;
-	int16 _iconToggleCount, _voiceCount;
 	uint32 _gameTime;
-	uint32 _lastTickCount, _thisTickCount;
-	uint32 _startSecondCount, _tSecondCount;
 
 	virtual void initMouse();
 	virtual void handleMouseMoved();
@@ -2083,14 +2080,42 @@
 
 	void loadMouseImage();
 
-	void dimpIdle();
-	virtual void timerProc();
-
 	void startOverlayAnims();
 	void startAnOverlayAnim();
 
 	virtual char *genSaveName(int slot);
 };
+
+
+class AGOSEngine_DIMP : public AGOSEngine_PuzzlePack {
+public:
+	AGOSEngine_DIMP(OSystem *system);
+	//~AGOSEngine_DIMP();
+
+	virtual void setupOpcodes();
+
+	virtual void executeOpcode(int opcode);
+
+protected:
+	typedef void (AGOSEngine_DIMP::*OpcodeProcDIMP) ();
+	struct OpcodeEntryDIMP {
+		OpcodeProcDIMP proc;
+		const char *desc;
+	};
+
+	const OpcodeEntryDIMP *_opcodesDIMP;
+
+	int16 _iconToggleCount, _voiceCount;
+	uint32 _lastTickCount;
+	uint32 _startSecondCount, _tSecondCount;
+
+	void odp_saveUserGame();
+	void odp_loadUserGame();
+
+	void dimpIdle();
+	virtual void timerProc();
+
+};
 #endif
 
 } // End of namespace AGOS

Modified: scummvm/trunk/engines/agos/detection.cpp
===================================================================
--- scummvm/trunk/engines/agos/detection.cpp	2009-09-24 02:56:37 UTC (rev 44284)
+++ scummvm/trunk/engines/agos/detection.cpp	2009-09-24 03:41:45 UTC (rev 44285)
@@ -166,7 +166,10 @@
 			*engine = new AGOS::AGOSEngine_Feeble(syst);
 		break;
 	case AGOS::GType_PP:
-		*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
+		if (gd->gameId == GID_DIMP)
+			*engine = new AGOS::AGOSEngine_DIMP(syst);
+		else
+			*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
 		break;
 #endif
 	default:

Modified: scummvm/trunk/engines/agos/event.cpp
===================================================================
--- scummvm/trunk/engines/agos/event.cpp	2009-09-24 02:56:37 UTC (rev 44284)
+++ scummvm/trunk/engines/agos/event.cpp	2009-09-24 03:41:45 UTC (rev 44285)
@@ -552,7 +552,7 @@
 }
 
 #ifdef ENABLE_AGOS2
-void AGOSEngine_PuzzlePack::timerProc() {
+void AGOSEngine_DIMP::timerProc() {
 	_lastTickCount = _system->getMillis();
 
 	AGOSEngine_Feeble::timerProc();
@@ -678,7 +678,7 @@
 }
 
 #ifdef ENABLE_AGOS2
-void AGOSEngine_PuzzlePack::dimpIdle() {
+void AGOSEngine_DIMP::dimpIdle() {
 	int z, n;
 
 	_iconToggleCount++;

Modified: scummvm/trunk/engines/agos/module.mk
===================================================================
--- scummvm/trunk/engines/agos/module.mk	2009-09-24 02:56:37 UTC (rev 44284)
+++ scummvm/trunk/engines/agos/module.mk	2009-09-24 03:41:45 UTC (rev 44285)
@@ -52,6 +52,7 @@
 	animation.o \
 	feeble.o \
 	oracle.o \
+	script_dp.o \
 	script_ff.o \
 	script_pp.o \
 	vga_ff.o

Added: scummvm/trunk/engines/agos/script_dp.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_dp.cpp	                        (rev 0)
+++ scummvm/trunk/engines/agos/script_dp.cpp	2009-09-24 03:41:45 UTC (rev 44285)
@@ -0,0 +1,313 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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.
+ *
+ * $$
+ * $$
+ *
+ */
+
+
+
+#ifdef ENABLE_AGOS2
+
+#include "common/system.h"
+
+#include "agos/agos.h"
+
+namespace AGOS {
+
+#define OPCODE(x)	_OPCODE(AGOSEngine_DIMP, x)
+
+void AGOSEngine_DIMP::setupOpcodes() {
+	static const OpcodeEntryDIMP opcodes[] = {
+		/* 00 */
+		OPCODE(o_invalid),
+		OPCODE(o_at),
+		OPCODE(o_notAt),
+		OPCODE(o_invalid),
+		/* 04 */
+		OPCODE(o_invalid),
+		OPCODE(o_carried),
+		OPCODE(o_notCarried),
+		OPCODE(o_isAt),
+		/* 08 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_zero),
+		/* 12 */
+		OPCODE(o_notZero),
+		OPCODE(o_eq),
+		OPCODE(o_notEq),
+		OPCODE(o_gt),
+		/* 16 */
+		OPCODE(o_lt),
+		OPCODE(o_eqf),
+		OPCODE(o_notEqf),
+		OPCODE(o_ltf),
+		/* 20 */
+		OPCODE(o_gtf),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(off_chance),
+		/* 24 */
+		OPCODE(o_invalid),
+		OPCODE(o_isRoom),
+		OPCODE(o_isObject),
+		OPCODE(o_state),
+		/* 28 */
+		OPCODE(o_oflag),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_destroy),
+		/* 32 */
+		OPCODE(o_invalid),
+		OPCODE(o_place),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 36 */
+		OPCODE(o_copyff),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 40 */
+		OPCODE(o_invalid),
+		OPCODE(o_clear),
+		OPCODE(o_let),
+		OPCODE(o_add),
+		/* 44 */
+		OPCODE(o_sub),
+		OPCODE(o_addf),
+		OPCODE(o_subf),
+		OPCODE(o_mul),
+		/* 48 */
+		OPCODE(o_div),
+		OPCODE(o_mulf),
+		OPCODE(o_divf),
+		OPCODE(o_mod),
+		/* 52 */
+		OPCODE(o_modf),
+		OPCODE(o_random),
+		OPCODE(o_invalid),
+		OPCODE(o_goto),
+		/* 56 */
+		OPCODE(o_oset),
+		OPCODE(o_oclear),
+		OPCODE(o_putBy),
+		OPCODE(o_inc),
+		/* 60 */
+		OPCODE(o_dec),
+		OPCODE(o_setState),
+		OPCODE(o_print),
+		OPCODE(o_message),
+		/* 64 */
+		OPCODE(o_msg),
+		OPCODE(off_addTextBox),
+		OPCODE(opp_setShortText),
+		OPCODE(oww_setLongText),
+		/* 68 */
+		OPCODE(o_end),
+		OPCODE(o_done),
+		OPCODE(off_printLongText),
+		OPCODE(o_process),
+		/* 72 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 76 */
+		OPCODE(o_when),
+		OPCODE(o_if1),
+		OPCODE(o_if2),
+		OPCODE(o_isCalled),
+		/* 80 */
+		OPCODE(o_is),
+		OPCODE(o_invalid),
+		OPCODE(o_debug),
+		OPCODE(os2_rescan),
+		/* 84 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_comment),
+		/* 88 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_getParent),
+		OPCODE(o_getNext),
+		/* 92 */
+		OPCODE(o_getChildren),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 96 */
+		OPCODE(o_picture),
+		OPCODE(o_loadZone),
+		OPCODE(os2_animate),
+		OPCODE(os2_stopAnimate),
+		/* 100 */
+		OPCODE(o_killAnimate),
+		OPCODE(o_defWindow),
+		OPCODE(o_window),
+		OPCODE(o_cls),
+		/* 104 */
+		OPCODE(o_closeWindow),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(off_addBox),
+		/* 108 */
+		OPCODE(o_delBox),
+		OPCODE(o_enableBox),
+		OPCODE(o_disableBox),
+		OPCODE(o_moveBox),
+		/* 112 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_doIcons),
+		OPCODE(o_isClass),
+		/* 116 */
+		OPCODE(o_setClass),
+		OPCODE(o_unsetClass),
+		OPCODE(o_invalid),
+		OPCODE(o_waitSync),
+		/* 120 */
+		OPCODE(o_sync),
+		OPCODE(o_defObj),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 124 */
+		OPCODE(off_ifTime),
+		OPCODE(o_here),
+		OPCODE(o_doClassIcons),
+		OPCODE(o_invalid),
+		/* 128 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_setAdjNoun),
+		OPCODE(off_setTime),
+		/* 132 */
+		OPCODE(odp_saveUserGame),
+		OPCODE(odp_loadUserGame),
+		OPCODE(off_listSaveGames),
+		OPCODE(o_invalid),
+		/* 136 */
+		OPCODE(o_copysf),
+		OPCODE(o_restoreIcons),
+		OPCODE(o_freezeZones),
+		OPCODE(o_placeNoIcons),
+		/* 140 */
+		OPCODE(o_clearTimers),
+		OPCODE(o_setDollar),
+		OPCODE(o_isBox),
+		OPCODE(oe2_doTable),
+		/* 144 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 148 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(oe2_storeItem),
+		/* 152 */
+		OPCODE(oe2_getItem),
+		OPCODE(oe2_bSet),
+		OPCODE(oe2_bClear),
+		OPCODE(oe2_bZero),
+		/* 156 */
+		OPCODE(oe2_bNotZero),
+		OPCODE(oe2_getOValue),
+		OPCODE(oe2_setOValue),
+		OPCODE(o_invalid),
+		/* 160 */
+		OPCODE(oe2_ink),
+		OPCODE(off_screenTextBox),
+		OPCODE(opp_playTune),
+		OPCODE(o_invalid),
+		/* 164 */
+		OPCODE(oe2_getDollar2),
+		OPCODE(off_isAdjNoun),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 168 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 172 */
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		OPCODE(oww_lockZones),
+		/* 176 */
+		OPCODE(oww_unlockZones),
+		OPCODE(off_screenTextPObj),
+		OPCODE(os1_getPathPosn),
+		OPCODE(os1_scnTxtLongText),
+		/* 180 */
+		OPCODE(os1_mouseOn),
+		OPCODE(off_mouseOff),
+		OPCODE(o_invalid),
+		OPCODE(o_invalid),
+		/* 184 */
+		OPCODE(os1_unloadZone),
+		OPCODE(o_invalid),
+		OPCODE(os1_unfreezeZones),
+		OPCODE(off_centreScroll),
+		/* 188 */
+		OPCODE(os2_isShortText),
+		OPCODE(os2_clearMarks),
+		OPCODE(os2_waitMark),
+		OPCODE(opp_resetPVCount),
+		/* 192 */
+		OPCODE(opp_setPathValues),
+		OPCODE(off_stopClock),
+		OPCODE(off_restartClock),
+		OPCODE(off_setColour),
+	};
+
+	_opcodesDIMP = opcodes;
+	_numOpcodes = 196;
+}
+
+void AGOSEngine_DIMP::executeOpcode(int opcode) {
+	OpcodeProcDIMP op = _opcodesDIMP[opcode].proc;
+	(this->*op) ();
+}
+
+// -----------------------------------------------------------------------
+// DIMP Opcodes
+// -----------------------------------------------------------------------
+
+
+void AGOSEngine_DIMP::odp_saveUserGame() {
+	// 132: save game
+	saveGame(1, NULL);
+}
+
+void AGOSEngine_DIMP::odp_loadUserGame() {
+	// 133: load usergame
+	loadGame(genSaveName(1));
+}
+
+} // End of namespace AGOS
+
+#endif // ENABLE_AGOS2


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

Modified: scummvm/trunk/engines/agos/script_pp.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_pp.cpp	2009-09-24 02:56:37 UTC (rev 44284)
+++ scummvm/trunk/engines/agos/script_pp.cpp	2009-09-24 03:41:45 UTC (rev 44285)
@@ -385,9 +385,7 @@
 		_gameTime += getTime() - _clockStopped;
 	_clockStopped = 0;
 
-	if (getGameId() == GID_DIMP) {
-		saveGame(1, NULL);
-	} else if (!getBitFlag(110)) {
+	if (!getBitFlag(110)) {
 		// Swampy adventures
 		saveGame(1, NULL);
 	}


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