[Scummvm-cvs-logs] SF.net SVN: scummvm: [24599] scummvm/trunk/engines/touche

chrilith at users.sourceforge.net chrilith at users.sourceforge.net
Sat Nov 4 16:09:27 CET 2006


Revision: 24599
          http://svn.sourceforge.net/scummvm/?rev=24599&view=rev
Author:   chrilith
Date:     2006-11-04 07:09:20 -0800 (Sat, 04 Nov 2006)

Log Message:
-----------
Fixed zero filled _opcodeTable[] with PalmOS ARM compiler

Modified Paths:
--------------
    scummvm/trunk/engines/touche/staticres.cpp
    scummvm/trunk/engines/touche/touche.cpp
    scummvm/trunk/engines/touche/touche.h

Modified: scummvm/trunk/engines/touche/staticres.cpp
===================================================================
--- scummvm/trunk/engines/touche/staticres.cpp	2006-11-04 12:00:31 UTC (rev 24598)
+++ scummvm/trunk/engines/touche/staticres.cpp	2006-11-04 15:09:20 UTC (rev 24599)
@@ -27,177 +27,181 @@
 
 namespace Touche {
 
-ToucheEngine::OpcodeProc ToucheEngine::_opcodesTable[NUM_OPCODES] = {
-	/* 0x00 */
-	&ToucheEngine::op_nop,
-	&ToucheEngine::op_jnz,
-	&ToucheEngine::op_jz,
-	&ToucheEngine::op_jmp,
-	/* 0x04 */
-	&ToucheEngine::op_true,
-	&ToucheEngine::op_false,
-	&ToucheEngine::op_push,
-	&ToucheEngine::op_testFalse,
-	/* 0x08 */
-	&ToucheEngine::op_add,
-	&ToucheEngine::op_sub,
-	&ToucheEngine::op_mul,
-	&ToucheEngine::op_div,
-	/* 0x0C */
-	&ToucheEngine::op_mod,
-	&ToucheEngine::op_and,
-	&ToucheEngine::op_or,
-	&ToucheEngine::op_not,
-	/* 0x10 */
-	&ToucheEngine::op_testGreater,
-	&ToucheEngine::op_testEquals,
-	&ToucheEngine::op_testLower,
-	&ToucheEngine::op_fetchScriptWord,
-	/* 0x14 */
-	0,
-	0,
-	0,
-	0,
-	/* 0x18 */
-	&ToucheEngine::op_testGreaterOrEquals,
-	&ToucheEngine::op_testLowerOrEquals,
-	&ToucheEngine::op_testNotEquals,
-	&ToucheEngine::op_endConversation,
-	/* 0x1C */
-	&ToucheEngine::op_stopScript,
-	&ToucheEngine::op_getFlag,
-	&ToucheEngine::op_setFlag,
-	0,
-	/* 0x20 */
-	0,
-	0,
-	0,
-	&ToucheEngine::op_fetchScriptByte,
-	/* 0x24 */
-	0,
-	0,
-	0,
-	0,
-	/* 0x28 */
-	&ToucheEngine::op_getScriptValue,
-	&ToucheEngine::op_setScriptValue,
-	0,
-	0,
-	/* 0x2C */
-	0,
-	0,
-	&ToucheEngine::op_getKeyCharWalkBox,
-	&ToucheEngine::op_startSound,
-	/* 0x30 */
-	&ToucheEngine::op_initKeyCharTalk,
-	0,
-	0,
-	0,
-	/* 0x34 */
-	&ToucheEngine::op_loadRoom,
-	&ToucheEngine::op_updateRoom,
-	&ToucheEngine::op_startTalk,
-	&ToucheEngine::op_setKeyCharBox,
-	/* 0x38 */
-	&ToucheEngine::op_initKeyCharScript,
-	&ToucheEngine::op_loadSprite,
-	&ToucheEngine::op_loadSequence,
-	&ToucheEngine::op_setKeyCharFrame,
-	/* 0x3C */
-	&ToucheEngine::op_setKeyCharDirection,
-	&ToucheEngine::op_clearConversationChoices,
-	&ToucheEngine::op_addConversationChoice,
-	&ToucheEngine::op_removeConversationChoice,
-	/* 0x40 */
-	&ToucheEngine::op_getInventoryItem,
-	&ToucheEngine::op_setInventoryItem,
-	&ToucheEngine::op_startEpisode,
-	&ToucheEngine::op_setConversationNum,
-	/* 0x44 */
-	&ToucheEngine::op_enableInventoryItem,
-	&ToucheEngine::op_enableInput,
-	&ToucheEngine::op_disableInput,
-	&ToucheEngine::op_faceKeyChar,
-	/* 0x48 */
-	&ToucheEngine::op_getKeyCharCurrentAnim,
-	&ToucheEngine::op_getCurrentKeyChar,
-	&ToucheEngine::op_isKeyCharActive,
-	&ToucheEngine::op_setPalette,
-	/* 0x4C */
-	&ToucheEngine::op_changeWalkPath,
-	&ToucheEngine::op_lockWalkPath,
-	&ToucheEngine::op_initializeKeyChar,
-	&ToucheEngine::op_setupWaitingKeyChars,
-	/* 0x50 */
-	&ToucheEngine::op_updateRoomAreas,
-	&ToucheEngine::op_unlockWalkPath,
-	0,
-	&ToucheEngine::op_addItemToInventoryAndRedraw,
-	/* 0x54 */
-	&ToucheEngine::op_giveItemTo,
-	&ToucheEngine::op_resetHitBoxes,
-	&ToucheEngine::op_fadePalette,
-	0,
-	/* 0x58 */
-	&ToucheEngine::op_disableInventoryItem,
-	0,
-	0,
-	0,
-	/* 0x5C */
-	0,
-	0,
-	0,
-	0,
-	/* 0x60 */
-	0,
-	&ToucheEngine::op_getInventoryItemFlags,
-	&ToucheEngine::op_drawInventory,
-	&ToucheEngine::op_stopKeyCharScript,
-	/* 0x64 */
-	&ToucheEngine::op_restartKeyCharScript,
-	&ToucheEngine::op_getKeyCharCurrentWalkBox,
-	&ToucheEngine::op_getKeyCharPointsDataNum,
-	&ToucheEngine::op_setupFollowingKeyChar,
-	/* 0x68 */
-	&ToucheEngine::op_startAnimation,
-	&ToucheEngine::op_setKeyCharTextColor,
-	0,
-	0,
-	/* 0x6C */
-	0,
-	0,
-	0,
-	0,
-	/* 0x70 */
-	&ToucheEngine::op_startMusic,
-	0,
-	0,
-	&ToucheEngine::op_copyPaletteColor,
-	/* 0x74 */
-	&ToucheEngine::op_delay,
-	&ToucheEngine::op_lockHitBox,
-	&ToucheEngine::op_removeItemFromInventory,
-	&ToucheEngine::op_unlockHitBox,
-	/* 0x78 */
-	&ToucheEngine::op_addRoomArea,
-	&ToucheEngine::op_setKeyCharFlags,
-	0,
-	0,
-	/* 0x7C */
-	0,
-	0,
-	0,
-	0,
-	/* 0x80 */
-	&ToucheEngine::op_unsetKeyCharFlags,
-	&ToucheEngine::op_drawSpriteOnBackdrop,
-	&ToucheEngine::op_loadVoice,
-	0,
-	/* 0x84 */
-	&ToucheEngine::op_startPaletteFadeIn,
-	&ToucheEngine::op_startPaletteFadeOut,
-	&ToucheEngine::op_setRoomAreaState
-};
+void ToucheEngine::setupOpcodes() {
+	static const OpcodeProc opcodesTable[NUM_OPCODES] = {
+		/* 0x00 */
+		&ToucheEngine::op_nop,
+		&ToucheEngine::op_jnz,
+		&ToucheEngine::op_jz,
+		&ToucheEngine::op_jmp,
+		/* 0x04 */
+		&ToucheEngine::op_true,
+		&ToucheEngine::op_false,
+		&ToucheEngine::op_push,
+		&ToucheEngine::op_testFalse,
+		/* 0x08 */
+		&ToucheEngine::op_add,
+		&ToucheEngine::op_sub,
+		&ToucheEngine::op_mul,
+		&ToucheEngine::op_div,
+		/* 0x0C */
+		&ToucheEngine::op_mod,
+		&ToucheEngine::op_and,
+		&ToucheEngine::op_or,
+		&ToucheEngine::op_not,
+		/* 0x10 */
+		&ToucheEngine::op_testGreater,
+		&ToucheEngine::op_testEquals,
+		&ToucheEngine::op_testLower,
+		&ToucheEngine::op_fetchScriptWord,
+		/* 0x14 */
+		0,
+		0,
+		0,
+		0,
+		/* 0x18 */
+		&ToucheEngine::op_testGreaterOrEquals,
+		&ToucheEngine::op_testLowerOrEquals,
+		&ToucheEngine::op_testNotEquals,
+		&ToucheEngine::op_endConversation,
+		/* 0x1C */
+		&ToucheEngine::op_stopScript,
+		&ToucheEngine::op_getFlag,
+		&ToucheEngine::op_setFlag,
+		0,
+		/* 0x20 */
+		0,
+		0,
+		0,
+		&ToucheEngine::op_fetchScriptByte,
+		/* 0x24 */
+		0,
+		0,
+		0,
+		0,
+		/* 0x28 */
+		&ToucheEngine::op_getScriptValue,
+		&ToucheEngine::op_setScriptValue,
+		0,
+		0,
+		/* 0x2C */
+		0,
+		0,
+		&ToucheEngine::op_getKeyCharWalkBox,
+		&ToucheEngine::op_startSound,
+		/* 0x30 */
+		&ToucheEngine::op_initKeyCharTalk,
+		0,
+		0,
+		0,
+		/* 0x34 */
+		&ToucheEngine::op_loadRoom,
+		&ToucheEngine::op_updateRoom,
+		&ToucheEngine::op_startTalk,
+		&ToucheEngine::op_setKeyCharBox,
+		/* 0x38 */
+		&ToucheEngine::op_initKeyCharScript,
+		&ToucheEngine::op_loadSprite,
+		&ToucheEngine::op_loadSequence,
+		&ToucheEngine::op_setKeyCharFrame,
+		/* 0x3C */
+		&ToucheEngine::op_setKeyCharDirection,
+		&ToucheEngine::op_clearConversationChoices,
+		&ToucheEngine::op_addConversationChoice,
+		&ToucheEngine::op_removeConversationChoice,
+		/* 0x40 */
+		&ToucheEngine::op_getInventoryItem,
+		&ToucheEngine::op_setInventoryItem,
+		&ToucheEngine::op_startEpisode,
+		&ToucheEngine::op_setConversationNum,
+		/* 0x44 */
+		&ToucheEngine::op_enableInventoryItem,
+		&ToucheEngine::op_enableInput,
+		&ToucheEngine::op_disableInput,
+		&ToucheEngine::op_faceKeyChar,
+		/* 0x48 */
+		&ToucheEngine::op_getKeyCharCurrentAnim,
+		&ToucheEngine::op_getCurrentKeyChar,
+		&ToucheEngine::op_isKeyCharActive,
+		&ToucheEngine::op_setPalette,
+		/* 0x4C */
+		&ToucheEngine::op_changeWalkPath,
+		&ToucheEngine::op_lockWalkPath,
+		&ToucheEngine::op_initializeKeyChar,
+		&ToucheEngine::op_setupWaitingKeyChars,
+		/* 0x50 */
+		&ToucheEngine::op_updateRoomAreas,
+		&ToucheEngine::op_unlockWalkPath,
+		0,
+		&ToucheEngine::op_addItemToInventoryAndRedraw,
+		/* 0x54 */
+		&ToucheEngine::op_giveItemTo,
+		&ToucheEngine::op_resetHitBoxes,
+		&ToucheEngine::op_fadePalette,
+		0,
+		/* 0x58 */
+		&ToucheEngine::op_disableInventoryItem,
+		0,
+		0,
+		0,
+		/* 0x5C */
+		0,
+		0,
+		0,
+		0,
+		/* 0x60 */
+		0,
+		&ToucheEngine::op_getInventoryItemFlags,
+		&ToucheEngine::op_drawInventory,
+		&ToucheEngine::op_stopKeyCharScript,
+		/* 0x64 */
+		&ToucheEngine::op_restartKeyCharScript,
+		&ToucheEngine::op_getKeyCharCurrentWalkBox,
+		&ToucheEngine::op_getKeyCharPointsDataNum,
+		&ToucheEngine::op_setupFollowingKeyChar,
+		/* 0x68 */
+		&ToucheEngine::op_startAnimation,
+		&ToucheEngine::op_setKeyCharTextColor,
+		0,
+		0,
+		/* 0x6C */
+		0,
+		0,
+		0,
+		0,
+		/* 0x70 */
+		&ToucheEngine::op_startMusic,
+		0,
+		0,
+		&ToucheEngine::op_copyPaletteColor,
+		/* 0x74 */
+		&ToucheEngine::op_delay,
+		&ToucheEngine::op_lockHitBox,
+		&ToucheEngine::op_removeItemFromInventory,
+		&ToucheEngine::op_unlockHitBox,
+		/* 0x78 */
+		&ToucheEngine::op_addRoomArea,
+		&ToucheEngine::op_setKeyCharFlags,
+		0,
+		0,
+		/* 0x7C */
+		0,
+		0,
+		0,
+		0,
+		/* 0x80 */
+		&ToucheEngine::op_unsetKeyCharFlags,
+		&ToucheEngine::op_drawSpriteOnBackdrop,
+		&ToucheEngine::op_loadVoice,
+		0,
+		/* 0x84 */
+		&ToucheEngine::op_startPaletteFadeIn,
+		&ToucheEngine::op_startPaletteFadeOut,
+		&ToucheEngine::op_setRoomAreaState
+	};
+	
+	_opcodesTable = opcodesTable;
+}
 
 SpriteData ToucheEngine::_spritesTable[NUM_SPRITES] = {
 	{ 0x34BC0, 0, 0, 0, 0, 0 },

Modified: scummvm/trunk/engines/touche/touche.cpp
===================================================================
--- scummvm/trunk/engines/touche/touche.cpp	2006-11-04 12:00:31 UTC (rev 24598)
+++ scummvm/trunk/engines/touche/touche.cpp	2006-11-04 15:09:20 UTC (rev 24599)
@@ -64,6 +64,7 @@
 	_fullRedrawCounter = 0;
 	_redrawScreenCounter1 = 0;
 	memset(_paletteBuffer, 0, sizeof(_paletteBuffer));
+	setupOpcodes();
 
 	Common::addSpecialDebugLevel(kDebugEngine,   "Engine",   "Engine debug level");
 	Common::addSpecialDebugLevel(kDebugGraphics, "Graphics", "Graphics debug level");

Modified: scummvm/trunk/engines/touche/touche.h
===================================================================
--- scummvm/trunk/engines/touche/touche.h	2006-11-04 12:00:31 UTC (rev 24598)
+++ scummvm/trunk/engines/touche/touche.h	2006-11-04 15:09:20 UTC (rev 24599)
@@ -729,11 +729,13 @@
 	uint8 *_offscreenBuffer;
 	uint8 _paletteBuffer[256 * 4];
 
-	static OpcodeProc _opcodesTable[NUM_OPCODES];
 	static SpriteData _spritesTable[NUM_SPRITES];
 	static const uint8 _directionsTable[];
 	static char _saveLoadDescriptionsTable[10][33];
 	static const Common::Rect _inventoryAreasTable[13];
+
+	const OpcodeProc *_opcodesTable;
+	void setupOpcodes();
 };
 
 /*


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