diff options
Diffstat (limited to 'engines/kyra/script_v1.cpp')
-rw-r--r-- | engines/kyra/script_v1.cpp | 322 |
1 files changed, 161 insertions, 161 deletions
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index 50ad1b8b0c..a258482802 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -37,13 +37,13 @@ #include "kyra/timer.h" namespace Kyra { -int KyraEngine_v1::o1_magicInMouseItem(ScriptState *script) { +int KyraEngine_v1::o1_magicInMouseItem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_magicInMouseItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); magicInMouseItem(stackPos(0), stackPos(1), -1); return 0; } -int KyraEngine_v1::o1_characterSays(ScriptState *script) { +int KyraEngine_v1::o1_characterSays(EMCState *script) { _skipFlag = false; if (_flags.isTalkie) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_characterSays(%p) (%d, '%s', %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3)); @@ -74,7 +74,7 @@ int KyraEngine_v1::o1_characterSays(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_pauseTicks(ScriptState *script) { +int KyraEngine_v1::o1_pauseTicks(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseTicks(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); if (stackPos(1)) { warning("STUB: special o1_pauseTicks"); @@ -86,33 +86,33 @@ int KyraEngine_v1::o1_pauseTicks(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_drawSceneAnimShape(ScriptState *script) { +int KyraEngine_v1::o1_drawSceneAnimShape(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawSceneAnimShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); _screen->drawShape(stackPos(4), _sprites->_sceneShapes[stackPos(0)], stackPos(1), stackPos(2), 0, (stackPos(3) != 0) ? 1 : 0); return 0; } -int KyraEngine_v1::o1_queryGameFlag(ScriptState *script) { +int KyraEngine_v1::o1_queryGameFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryGameFlag(%p) (0x%X)", (const void *)script, stackPos(0)); return queryGameFlag(stackPos(0)); } -int KyraEngine_v1::o1_setGameFlag(ScriptState *script) { +int KyraEngine_v1::o1_setGameFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setGameFlag(%p) (0x%X)", (const void *)script, stackPos(0)); return setGameFlag(stackPos(0)); } -int KyraEngine_v1::o1_resetGameFlag(ScriptState *script) { +int KyraEngine_v1::o1_resetGameFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_resetGameFlag(%p) (0x%X)", (const void *)script, stackPos(0)); return resetGameFlag(stackPos(0)); } -int KyraEngine_v1::o1_runNPCScript(ScriptState *script) { +int KyraEngine_v1::o1_runNPCScript(EMCState *script) { warning("STUB: o1_runNPCScript"); return 0; } -int KyraEngine_v1::o1_setSpecialExitList(ScriptState *script) { +int KyraEngine_v1::o1_setSpecialExitList(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSpecialExitList(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9)); for (int i = 0; i < 10; ++i) @@ -122,19 +122,19 @@ int KyraEngine_v1::o1_setSpecialExitList(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_blockInWalkableRegion(ScriptState *script) { +int KyraEngine_v1::o1_blockInWalkableRegion(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_blockInWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); _screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1); return 0; } -int KyraEngine_v1::o1_blockOutWalkableRegion(ScriptState *script) { +int KyraEngine_v1::o1_blockOutWalkableRegion(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_blockOutWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); _screen->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1); return 0; } -int KyraEngine_v1::o1_walkPlayerToPoint(ScriptState *script) { +int KyraEngine_v1::o1_walkPlayerToPoint(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkPlayerToPoint(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int normalTimers = stackPos(2); @@ -153,7 +153,7 @@ int KyraEngine_v1::o1_walkPlayerToPoint(ScriptState *script) { } if (reinitScript) - _scriptInterpreter->initScript(script, script->dataPtr); + _emc->init(script, script->dataPtr); if (_sceneChangeState) { _sceneChangeState = 0; @@ -162,7 +162,7 @@ int KyraEngine_v1::o1_walkPlayerToPoint(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_dropItemInScene(ScriptState *script) { +int KyraEngine_v1::o1_dropItemInScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dropItemInScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); int item = stackPos(0); int xpos = stackPos(1); @@ -187,7 +187,7 @@ int KyraEngine_v1::o1_dropItemInScene(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_drawAnimShapeIntoScene(ScriptState *script) { +int KyraEngine_v1::o1_drawAnimShapeIntoScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawAnimShapeIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); _screen->hideMouse(); _animator->restoreAllObjectBackgrounds(); @@ -205,49 +205,49 @@ int KyraEngine_v1::o1_drawAnimShapeIntoScene(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_createMouseItem(ScriptState *script) { +int KyraEngine_v1::o1_createMouseItem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_createMouseItem(%p) (%d)", (const void *)script, stackPos(0)); createMouseItem(stackPos(0)); return 0; } -int KyraEngine_v1::o1_savePageToDisk(ScriptState *script) { +int KyraEngine_v1::o1_savePageToDisk(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_savePageToDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); _screen->savePageToDisk(stackPosString(0), stackPos(1)); return 0; } -int KyraEngine_v1::o1_sceneAnimOn(ScriptState *script) { +int KyraEngine_v1::o1_sceneAnimOn(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimOn(%p) (%d)", (const void *)script, stackPos(0)); _sprites->_anims[stackPos(0)].play = true; return 0; } -int KyraEngine_v1::o1_sceneAnimOff(ScriptState *script) { +int KyraEngine_v1::o1_sceneAnimOff(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimOff(%p) (%d)", (const void *)script, stackPos(0)); _sprites->_anims[stackPos(0)].play = false; return 0; } -int KyraEngine_v1::o1_getElapsedSeconds(ScriptState *script) { +int KyraEngine_v1::o1_getElapsedSeconds(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getElapsedSeconds(%p) ()", (const void *)script); return _system->getMillis() / 1000; } -int KyraEngine_v1::o1_mouseIsPointer(ScriptState *script) { +int KyraEngine_v1::o1_mouseIsPointer(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_mouseIsPointer(%p) ()", (const void *)script); if (_itemInHand == -1) return 1; return 0; } -int KyraEngine_v1::o1_destroyMouseItem(ScriptState *script) { +int KyraEngine_v1::o1_destroyMouseItem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_destroyMouseItem(%p) ()", (const void *)script); destroyMouseItem(); return 0; } -int KyraEngine_v1::o1_runSceneAnimUntilDone(ScriptState *script) { +int KyraEngine_v1::o1_runSceneAnimUntilDone(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runSceneAnimUntilDone(%p) (%d)", (const void *)script, stackPos(0)); _screen->hideMouse(); _animator->restoreAllObjectBackgrounds(); @@ -265,7 +265,7 @@ int KyraEngine_v1::o1_runSceneAnimUntilDone(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_fadeSpecialPalette(ScriptState *script) { +int KyraEngine_v1::o1_fadeSpecialPalette(EMCState *script) { if (_flags.platform == Common::kPlatformAmiga) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fadeSpecialPalette(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); if (_currentCharacter->sceneId != 45) { @@ -283,42 +283,42 @@ int KyraEngine_v1::o1_fadeSpecialPalette(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_playAdlibSound(ScriptState *script) { +int KyraEngine_v1::o1_playAdlibSound(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playAdlibSound(%p) (%d)", (const void *)script, stackPos(0)); snd_playSoundEffect(stackPos(0)); return 0; } -int KyraEngine_v1::o1_playAdlibScore(ScriptState *script) { +int KyraEngine_v1::o1_playAdlibScore(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playAdlibScore(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); snd_playWanderScoreViaMap(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v1::o1_phaseInSameScene(ScriptState *script) { +int KyraEngine_v1::o1_phaseInSameScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_phaseInSameScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); transcendScenes(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v1::o1_setScenePhasingFlag(ScriptState *script) { +int KyraEngine_v1::o1_setScenePhasingFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScenePhasingFlag(%p) ()", (const void *)script); _scenePhasingFlag = 1; return 1; } -int KyraEngine_v1::o1_resetScenePhasingFlag(ScriptState *script) { +int KyraEngine_v1::o1_resetScenePhasingFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_resetScenePhasingFlag(%p) ()", (const void *)script); _scenePhasingFlag = 0; return 0; } -int KyraEngine_v1::o1_queryScenePhasingFlag(ScriptState *script) { +int KyraEngine_v1::o1_queryScenePhasingFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryScenePhasingFlag(%p) ()", (const void *)script); return _scenePhasingFlag; } -int KyraEngine_v1::o1_sceneToDirection(ScriptState *script) { +int KyraEngine_v1::o1_sceneToDirection(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneToDirection(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) < _roomTableSize); Room *curRoom = &_roomTable[stackPos(0)]; @@ -348,7 +348,7 @@ int KyraEngine_v1::o1_sceneToDirection(ScriptState *script) { return returnValue; } -int KyraEngine_v1::o1_setBirthstoneGem(ScriptState *script) { +int KyraEngine_v1::o1_setBirthstoneGem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBirthstoneGem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); int index = stackPos(0); if (index < 4 && index >= 0) { @@ -358,19 +358,19 @@ int KyraEngine_v1::o1_setBirthstoneGem(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_placeItemInGenericMapScene(ScriptState *script) { +int KyraEngine_v1::o1_placeItemInGenericMapScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeItemInGenericMapScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); placeItemInGenericMapScene(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v1::o1_setBrandonStatusBit(ScriptState *script) { +int KyraEngine_v1::o1_setBrandonStatusBit(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBrandonStatusBit(%p) (%d)", (const void *)script, stackPos(0)); _brandonStatusBit |= stackPos(0); return 0; } -int KyraEngine_v1::o1_pauseSeconds(ScriptState *script) { +int KyraEngine_v1::o1_pauseSeconds(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseSeconds(%p) (%d)", (const void *)script, stackPos(0)); if (stackPos(0) > 0 && !_skipFlag) delay(stackPos(0)*1000, true); @@ -378,41 +378,41 @@ int KyraEngine_v1::o1_pauseSeconds(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_getCharactersLocation(ScriptState *script) { +int KyraEngine_v1::o1_getCharactersLocation(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersLocation(%p) (%d)", (const void *)script, stackPos(0)); return _characterList[stackPos(0)].sceneId; } -int KyraEngine_v1::o1_runNPCSubscript(ScriptState *script) { +int KyraEngine_v1::o1_runNPCSubscript(EMCState *script) { warning("STUB: o1_runNPCSubscript"); return 0; } -int KyraEngine_v1::o1_magicOutMouseItem(ScriptState *script) { +int KyraEngine_v1::o1_magicOutMouseItem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_magicOutMouseItem(%p) (%d)", (const void *)script, stackPos(0)); magicOutMouseItem(stackPos(0), -1); return 0; } -int KyraEngine_v1::o1_internalAnimOn(ScriptState *script) { +int KyraEngine_v1::o1_internalAnimOn(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_internalAnimOn(%p) (%d)", (const void *)script, stackPos(0)); _animator->sprites()[stackPos(0)].active = 1; return 0; } -int KyraEngine_v1::o1_forceBrandonToNormal(ScriptState *script) { +int KyraEngine_v1::o1_forceBrandonToNormal(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_forceBrandonToNormal(%p) ()", (const void *)script); checkAmuletAnimFlags(); return 0; } -int KyraEngine_v1::o1_poisonDeathNow(ScriptState *script) { +int KyraEngine_v1::o1_poisonDeathNow(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_poisonDeathNow(%p) ()", (const void *)script); seq_poisonDeathNow(1); return 0; } -int KyraEngine_v1::o1_setScaleMode(ScriptState *script) { +int KyraEngine_v1::o1_setScaleMode(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScaleMode(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int len = stackPos(0); int setValue1 = stackPos(1); @@ -430,7 +430,7 @@ int KyraEngine_v1::o1_setScaleMode(ScriptState *script) { return _scaleMode; } -int KyraEngine_v1::o1_openWSAFile(ScriptState *script) { +int KyraEngine_v1::o1_openWSAFile(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_openWSAFile(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3)); const char *filename = stackPosString(0); @@ -442,7 +442,7 @@ int KyraEngine_v1::o1_openWSAFile(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_closeWSAFile(ScriptState *script) { +int KyraEngine_v1::o1_closeWSAFile(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_closeWSAFile(%p) (%d)", (const void *)script, stackPos(0)); int wsaIndex = stackPos(0); @@ -452,7 +452,7 @@ int KyraEngine_v1::o1_closeWSAFile(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_runWSAFromBeginningToEnd(ScriptState *script) { +int KyraEngine_v1::o1_runWSAFromBeginningToEnd(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runWSAFromBeginningToEnd(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); _screen->hideMouse(); @@ -493,7 +493,7 @@ int KyraEngine_v1::o1_runWSAFromBeginningToEnd(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_displayWSAFrame(ScriptState *script) { +int KyraEngine_v1::o1_displayWSAFrame(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSAFrame(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); int frame = stackPos(0); int xpos = stackPos(1); @@ -520,13 +520,13 @@ int KyraEngine_v1::o1_displayWSAFrame(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_enterNewScene(ScriptState *script) { +int KyraEngine_v1::o1_enterNewScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); enterNewScene(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); return 0; } -int KyraEngine_v1::o1_setSpecialEnterXAndY(ScriptState *script) { +int KyraEngine_v1::o1_setSpecialEnterXAndY(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSpecialEnterXAndY(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _brandonPosX = stackPos(0); _brandonPosY = stackPos(1); @@ -535,7 +535,7 @@ int KyraEngine_v1::o1_setSpecialEnterXAndY(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_runWSAFrames(ScriptState *script) { +int KyraEngine_v1::o1_runWSAFrames(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runWSAFrames(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); int xpos = stackPos(0); int ypos = stackPos(1); @@ -562,7 +562,7 @@ int KyraEngine_v1::o1_runWSAFrames(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_popBrandonIntoScene(ScriptState *script) { +int KyraEngine_v1::o1_popBrandonIntoScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_popBrandonIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int changeScaleMode = stackPos(3); int xpos = (int16)(stackPos(0) & 0xFFFC); @@ -576,7 +576,7 @@ int KyraEngine_v1::o1_popBrandonIntoScene(ScriptState *script) { int yOffset = _defaultShapeTable[0].yOffset; int width = _defaultShapeTable[0].w << 3; int height = _defaultShapeTable[0].h; - AnimObject *curAnim = _animator->actors(); + Animator_v1::AnimObject *curAnim = _animator->actors(); if (changeScaleMode) { curAnim->x1 = _currentCharacter->x1; @@ -611,7 +611,7 @@ int KyraEngine_v1::o1_popBrandonIntoScene(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_restoreAllObjectBackgrounds(ScriptState *script) { +int KyraEngine_v1::o1_restoreAllObjectBackgrounds(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreAllObjectBackgrounds(%p) (%d)", (const void *)script, stackPos(0)); int disable = stackPos(0); int activeBackup = 0; @@ -625,20 +625,20 @@ int KyraEngine_v1::o1_restoreAllObjectBackgrounds(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_setCustomPaletteRange(ScriptState *script) { +int KyraEngine_v1::o1_setCustomPaletteRange(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCustomPaletteRange(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); memcpy(_screen->getPalette(1) + stackPos(1)*3, _specialPalettes[stackPos(0)], stackPos(2)*3); return 0; } -int KyraEngine_v1::o1_loadPageFromDisk(ScriptState *script) { +int KyraEngine_v1::o1_loadPageFromDisk(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_loadPageFromDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); _screen->loadPageFromDisk(stackPosString(0), stackPos(1)); _animator->_updateScreen = true; return 0; } -int KyraEngine_v1::o1_customPrintTalkString(ScriptState *script) { +int KyraEngine_v1::o1_customPrintTalkString(EMCState *script) { if (_flags.isTalkie) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_customPrintTalkString(%p) (%d, '%s', %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF); @@ -659,35 +659,35 @@ int KyraEngine_v1::o1_customPrintTalkString(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_restoreCustomPrintBackground(ScriptState *script) { +int KyraEngine_v1::o1_restoreCustomPrintBackground(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreCustomPrintBackground(%p) ()", (const void *)script); _text->restoreTalkTextMessageBkgd(2, 0); return 0; } -int KyraEngine_v1::o1_hideMouse(ScriptState *script) { +int KyraEngine_v1::o1_hideMouse(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_hideMouse(%p) ()", (const void *)script); _screen->hideMouse(); return 0; } -int KyraEngine_v1::o1_showMouse(ScriptState *script) { +int KyraEngine_v1::o1_showMouse(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_showMouse(%p) ()", (const void *)script); _screen->showMouse(); return 0; } -int KyraEngine_v1::o1_getCharacterX(ScriptState *script) { +int KyraEngine_v1::o1_getCharacterX(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharacterX(%p) (%d)", (const void *)script, stackPos(0)); return _characterList[stackPos(0)].x1; } -int KyraEngine_v1::o1_getCharacterY(ScriptState *script) { +int KyraEngine_v1::o1_getCharacterY(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharacterY(%p) (%d)", (const void *)script, stackPos(0)); return _characterList[stackPos(0)].y1; } -int KyraEngine_v1::o1_changeCharactersFacing(ScriptState *script) { +int KyraEngine_v1::o1_changeCharactersFacing(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_changeCharactersFacing(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); int character = stackPos(0); int facing = stackPos(1); @@ -705,7 +705,7 @@ int KyraEngine_v1::o1_changeCharactersFacing(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_copyWSARegion(ScriptState *script) { +int KyraEngine_v1::o1_copyWSARegion(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_copyWSARegion(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); int xpos = stackPos(0); int ypos = stackPos(1); @@ -718,7 +718,7 @@ int KyraEngine_v1::o1_copyWSARegion(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_printText(ScriptState *script) { +int KyraEngine_v1::o1_printText(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_printText(%p) ('%s', %d, %d, 0x%X, 0x%X)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); if (_flags.lang == Common::JA_JPN && stackPos(3) == 7) _screen->printText(stackPosString(0), stackPos(1), stackPos(2), 0, 0x80); @@ -728,18 +728,18 @@ int KyraEngine_v1::o1_printText(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_random(ScriptState *script) { +int KyraEngine_v1::o1_random(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_random(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) < stackPos(1)); return _rnd.getRandomNumberRng(stackPos(0), stackPos(1)); } -int KyraEngine_v1::o1_loadSoundFile(ScriptState *script) { +int KyraEngine_v1::o1_loadSoundFile(EMCState *script) { warning("STUB: o1_loadSoundFile"); return 0; } -int KyraEngine_v1::o1_displayWSAFrameOnHidPage(ScriptState *script) { +int KyraEngine_v1::o1_displayWSAFrameOnHidPage(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSAFrameOnHidPage(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); int frame = stackPos(0); int xpos = stackPos(1); @@ -768,7 +768,7 @@ int KyraEngine_v1::o1_displayWSAFrameOnHidPage(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_displayWSASequentialFrames(ScriptState *script) { +int KyraEngine_v1::o1_displayWSASequentialFrames(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSASequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6)); int startFrame = stackPos(0); int endFrame = stackPos(1); @@ -844,7 +844,7 @@ int KyraEngine_v1::o1_displayWSASequentialFrames(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_drawCharacterStanding(ScriptState *script) { +int KyraEngine_v1::o1_drawCharacterStanding(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawCharacterStanding(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int character = stackPos(0); int animFrame = stackPos(1); @@ -859,13 +859,13 @@ int KyraEngine_v1::o1_drawCharacterStanding(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_internalAnimOff(ScriptState *script) { +int KyraEngine_v1::o1_internalAnimOff(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_internalAnimOff(%p) (%d)", (const void *)script, stackPos(0)); _animator->sprites()[stackPos(0)].active = 0; return 0; } -int KyraEngine_v1::o1_changeCharactersXAndY(ScriptState *script) { +int KyraEngine_v1::o1_changeCharactersXAndY(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_changeCharactersXAndY(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); Character *ch = &_characterList[stackPos(0)]; int16 x = stackPos(1); @@ -881,25 +881,25 @@ int KyraEngine_v1::o1_changeCharactersXAndY(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_clearSceneAnimatorBeacon(ScriptState *script) { +int KyraEngine_v1::o1_clearSceneAnimatorBeacon(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_clearSceneAnimatorBeacon(%p) ()", (const void *)script); _sprites->_sceneAnimatorBeaconFlag = 0; return 0; } -int KyraEngine_v1::o1_querySceneAnimatorBeacon(ScriptState *script) { +int KyraEngine_v1::o1_querySceneAnimatorBeacon(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_querySceneAnimatorBeacon(%p) ()", (const void *)script); return _sprites->_sceneAnimatorBeaconFlag; } -int KyraEngine_v1::o1_refreshSceneAnimator(ScriptState *script) { +int KyraEngine_v1::o1_refreshSceneAnimator(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_refreshSceneAnimator(%p) ()", (const void *)script); _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); return 0; } -int KyraEngine_v1::o1_placeItemInOffScene(ScriptState *script) { +int KyraEngine_v1::o1_placeItemInOffScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeItemInOffScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int item = stackPos(0); int xpos = stackPos(1); @@ -918,7 +918,7 @@ int KyraEngine_v1::o1_placeItemInOffScene(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_wipeDownMouseItem(ScriptState *script) { +int KyraEngine_v1::o1_wipeDownMouseItem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_wipeDownMouseItem(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); _screen->hideMouse(); wipeDownMouseItem(stackPos(1), stackPos(2)); @@ -927,7 +927,7 @@ int KyraEngine_v1::o1_wipeDownMouseItem(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_placeCharacterInOtherScene(ScriptState *script) { +int KyraEngine_v1::o1_placeCharacterInOtherScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeCharacterInOtherScene(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); int id = stackPos(0); int sceneId = stackPos(1); @@ -944,18 +944,18 @@ int KyraEngine_v1::o1_placeCharacterInOtherScene(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_getKey(ScriptState *script) { +int KyraEngine_v1::o1_getKey(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getKey(%p) ()", (const void *)script); waitForEvent(); return 0; } -int KyraEngine_v1::o1_specificItemInInventory(ScriptState *script) { +int KyraEngine_v1::o1_specificItemInInventory(EMCState *script) { warning("STUB: o1_specificItemInInventory"); return 0; } -int KyraEngine_v1::o1_popMobileNPCIntoScene(ScriptState *script) { +int KyraEngine_v1::o1_popMobileNPCIntoScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_popMobileNPCIntoScene(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), (int16)(stackPos(4) & 0xFFFC), (int8)(stackPos(5) & 0xFE)); int character = stackPos(0); int sceneId = stackPos(1); @@ -976,25 +976,25 @@ int KyraEngine_v1::o1_popMobileNPCIntoScene(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_mobileCharacterInScene(ScriptState *script) { +int KyraEngine_v1::o1_mobileCharacterInScene(EMCState *script) { warning("STUB: o1_mobileCharacterInScene"); return 0; } -int KyraEngine_v1::o1_hideMobileCharacter(ScriptState *script) { +int KyraEngine_v1::o1_hideMobileCharacter(EMCState *script) { warning("STUB: o1_hideMobileCharacter"); return 0; } -int KyraEngine_v1::o1_unhideMobileCharacter(ScriptState *script) { +int KyraEngine_v1::o1_unhideMobileCharacter(EMCState *script) { warning("STUB: o1_unhideMobileCharacter"); return 0; } -int KyraEngine_v1::o1_setCharactersLocation(ScriptState *script) { +int KyraEngine_v1::o1_setCharactersLocation(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersLocation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); Character *ch = &_characterList[stackPos(0)]; - AnimObject *animObj = &_animator->actors()[stackPos(0)]; + Animator_v1::AnimObject *animObj = &_animator->actors()[stackPos(0)]; int newScene = stackPos(1); if (_currentCharacter->sceneId == ch->sceneId) { if (_currentCharacter->sceneId != newScene) @@ -1008,7 +1008,7 @@ int KyraEngine_v1::o1_setCharactersLocation(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_walkCharacterToPoint(ScriptState *script) { +int KyraEngine_v1::o1_walkCharacterToPoint(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkCharacterToPoint(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); int character = stackPos(0); int toX = stackPos(1); @@ -1090,7 +1090,7 @@ int KyraEngine_v1::o1_walkCharacterToPoint(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_specialEventDisplayBrynnsNote(ScriptState *script) { +int KyraEngine_v1::o1_specialEventDisplayBrynnsNote(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_specialEventDisplayBrynnsNote(%p) ()", (const void *)script); _screen->hideMouse(); _screen->savePageToDisk("HIDPAGE.TMP", 2); @@ -1112,7 +1112,7 @@ int KyraEngine_v1::o1_specialEventDisplayBrynnsNote(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_specialEventRemoveBrynnsNote(ScriptState *script) { +int KyraEngine_v1::o1_specialEventRemoveBrynnsNote(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_specialEventRemoveBrynnsNote(%p) ()", (const void *)script); _screen->hideMouse(); _screen->loadPageFromDisk("SEENPAGE.TMP", 0); @@ -1123,13 +1123,13 @@ int KyraEngine_v1::o1_specialEventRemoveBrynnsNote(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_setLogicPage(ScriptState *script) { +int KyraEngine_v1::o1_setLogicPage(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setLogicPage(%p) (%d)", (const void *)script, stackPos(0)); _screen->_curPage = stackPos(0); return stackPos(0); } -int KyraEngine_v1::o1_fatPrint(ScriptState *script) { +int KyraEngine_v1::o1_fatPrint(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fatPrint(%p) ('%s', %d, %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); // Workaround for bug #1582672 ("KYRA1: Text crippled and drawn wrong") @@ -1142,13 +1142,13 @@ int KyraEngine_v1::o1_fatPrint(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_preserveAllObjectBackgrounds(ScriptState *script) { +int KyraEngine_v1::o1_preserveAllObjectBackgrounds(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_preserveAllObjectBackgrounds(%p) ()", (const void *)script); _animator->preserveAllBackgrounds(); return 0; } -int KyraEngine_v1::o1_updateSceneAnimations(ScriptState *script) { +int KyraEngine_v1::o1_updateSceneAnimations(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_updateSceneAnimations(%p) (%d)", (const void *)script, stackPos(0)); int times = stackPos(0); while (times--) { @@ -1158,23 +1158,23 @@ int KyraEngine_v1::o1_updateSceneAnimations(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_sceneAnimationActive(ScriptState *script) { +int KyraEngine_v1::o1_sceneAnimationActive(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimationActive(%p) (%d)", (const void *)script, stackPos(0)); return _sprites->_anims[stackPos(0)].play; } -int KyraEngine_v1::o1_setCharactersMovementDelay(ScriptState *script) { +int KyraEngine_v1::o1_setCharactersMovementDelay(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersMovementDelay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _timer->setDelay(stackPos(0)+5, stackPos(1)); return 0; } -int KyraEngine_v1::o1_getCharactersFacing(ScriptState *script) { +int KyraEngine_v1::o1_getCharactersFacing(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersFacing(%p) (%d)", (const void *)script, stackPos(0)); return _characterList[stackPos(0)].facing; } -int KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(ScriptState *script) { +int KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(%p) (%d)", (const void *)script, stackPos(0)); _screen->copyBackgroundBlock(stackPos(0), 2, 0); _screen->copyBackgroundBlock2(stackPos(0)); @@ -1188,13 +1188,13 @@ int KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_dispelMagicAnimation(ScriptState *script) { +int KyraEngine_v1::o1_dispelMagicAnimation(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dispelMagicAnimation(%p) ()", (const void *)script); seq_dispelMagicAnimation(); return 0; } -int KyraEngine_v1::o1_findBrightestFireberry(ScriptState *script) { +int KyraEngine_v1::o1_findBrightestFireberry(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_findBrightestFireberry(%p) ()", (const void *)script); if (_currentCharacter->sceneId >= 187 && _currentCharacter->sceneId <= 198) return 29; @@ -1238,7 +1238,7 @@ int KyraEngine_v1::o1_findBrightestFireberry(ScriptState *script) { return brightestFireberry; } -int KyraEngine_v1::o1_setFireberryGlowPalette(ScriptState *script) { +int KyraEngine_v1::o1_setFireberryGlowPalette(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setFireberryGlowPalette(%p) (%d)", (const void *)script, stackPos(0)); int palIndex = 0; switch (stackPos(0)) { @@ -1275,19 +1275,19 @@ int KyraEngine_v1::o1_setFireberryGlowPalette(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_setDeathHandlerFlag(ScriptState *script) { +int KyraEngine_v1::o1_setDeathHandlerFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setDeathHandlerFlag(%p) (%d)", (const void *)script, stackPos(0)); _deathHandler = stackPos(0); return 0; } -int KyraEngine_v1::o1_drinkPotionAnimation(ScriptState *script) { +int KyraEngine_v1::o1_drinkPotionAnimation(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drinkPotionAnimation(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); seq_playDrinkPotionAnim(stackPos(0), stackPos(1), stackPos(2)); return 0; } -int KyraEngine_v1::o1_makeAmuletAppear(ScriptState *script) { +int KyraEngine_v1::o1_makeAmuletAppear(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_makeAmuletAppear(%p) ()", (const void *)script); WSAMovieV1 amulet(this); amulet.open("AMULET.WSA", 1, 0); @@ -1328,7 +1328,7 @@ int KyraEngine_v1::o1_makeAmuletAppear(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_drawItemShapeIntoScene(ScriptState *script) { +int KyraEngine_v1::o1_drawItemShapeIntoScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawItemShapeIntoScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); int item = stackPos(0); int x = stackPos(1); @@ -1355,13 +1355,13 @@ int KyraEngine_v1::o1_drawItemShapeIntoScene(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_setCharactersCurrentFrame(ScriptState *script) { +int KyraEngine_v1::o1_setCharactersCurrentFrame(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _characterList[stackPos(0)].currentAnimFrame = stackPos(1); return 0; } -int KyraEngine_v1::o1_waitForConfirmationMouseClick(ScriptState *script) { +int KyraEngine_v1::o1_waitForConfirmationMouseClick(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_waitForConfirmationMouseClick(%p) ()", (const void *)script); // if (mouseEnabled) { while (!_mousePressFlag) { @@ -1386,39 +1386,39 @@ int KyraEngine_v1::o1_waitForConfirmationMouseClick(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_pageFlip(ScriptState *script) { +int KyraEngine_v1::o1_pageFlip(EMCState *script) { warning("STUB: o1_pageFlip"); return 0; } -int KyraEngine_v1::o1_setSceneFile(ScriptState *script) { +int KyraEngine_v1::o1_setSceneFile(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSceneFile(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); setSceneFile(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v1::o1_getItemInMarbleVase(ScriptState *script) { +int KyraEngine_v1::o1_getItemInMarbleVase(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getItemInMarbleVase(%p) ()", (const void *)script); return _marbleVaseItem; } -int KyraEngine_v1::o1_setItemInMarbleVase(ScriptState *script) { +int KyraEngine_v1::o1_setItemInMarbleVase(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setItemInMarbleVase(%p) (%d)", (const void *)script, stackPos(0)); _marbleVaseItem = stackPos(0); return 0; } -int KyraEngine_v1::o1_addItemToInventory(ScriptState *script) { +int KyraEngine_v1::o1_addItemToInventory(EMCState *script) { warning("STUB: o1_addItemToInventory"); return 0; } -int KyraEngine_v1::o1_intPrint(ScriptState *script) { +int KyraEngine_v1::o1_intPrint(EMCState *script) { warning("STUB: o1_intPrint"); return 0; } -int KyraEngine_v1::o1_shakeScreen(ScriptState *script) { +int KyraEngine_v1::o1_shakeScreen(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_shakeScreen(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); int waitTicks = stackPos(1); int times = stackPos(0); @@ -1431,57 +1431,57 @@ int KyraEngine_v1::o1_shakeScreen(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_createAmuletJewel(ScriptState *script) { +int KyraEngine_v1::o1_createAmuletJewel(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_createAmuletJewel(%p) (%d)", (const void *)script, stackPos(0)); seq_createAmuletJewel(stackPos(0), 0, 0, 0); return 0; } -int KyraEngine_v1::o1_setSceneAnimCurrXY(ScriptState *script) { +int KyraEngine_v1::o1_setSceneAnimCurrXY(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSceneAnimCurrXY(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); _sprites->_anims[stackPos(0)].x = stackPos(1); _sprites->_anims[stackPos(0)].y = stackPos(2); return 0; } -int KyraEngine_v1::o1_poisonBrandonAndRemaps(ScriptState *script) { +int KyraEngine_v1::o1_poisonBrandonAndRemaps(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_poisonBrandonAndRemaps(%p) ()", (const void *)script); setBrandonPoisonFlags(1); return 0; } -int KyraEngine_v1::o1_fillFlaskWithWater(ScriptState *script) { +int KyraEngine_v1::o1_fillFlaskWithWater(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fillFlaskWithWater(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); seq_fillFlaskWithWater(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v1::o1_getCharactersMovementDelay(ScriptState *script) { +int KyraEngine_v1::o1_getCharactersMovementDelay(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersMovementDelay(%p) (%d)", (const void *)script, stackPos(0)); return _timer->getDelay(stackPos(0)+5); } -int KyraEngine_v1::o1_getBirthstoneGem(ScriptState *script) { +int KyraEngine_v1::o1_getBirthstoneGem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getBirthstoneGem(%p) (%d)", (const void *)script, stackPos(0)); if (stackPos(0) < 4) return _birthstoneGemTable[stackPos(0)]; return 0; } -int KyraEngine_v1::o1_queryBrandonStatusBit(ScriptState *script) { +int KyraEngine_v1::o1_queryBrandonStatusBit(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryBrandonStatusBit(%p) (%d)", (const void *)script, stackPos(0)); if (_brandonStatusBit & stackPos(0)) return 1; return 0; } -int KyraEngine_v1::o1_playFluteAnimation(ScriptState *script) { +int KyraEngine_v1::o1_playFluteAnimation(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playFluteAnimation(%p) ()", (const void *)script); seq_playFluteAnimation(); return 0; } -int KyraEngine_v1::o1_playWinterScrollSequence(ScriptState *script) { +int KyraEngine_v1::o1_playWinterScrollSequence(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playWinterScrollSequence(%p) (%d)", (const void *)script, stackPos(0)); if (!stackPos(0)) seq_winterScroll2(); @@ -1490,40 +1490,40 @@ int KyraEngine_v1::o1_playWinterScrollSequence(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_getIdolGem(ScriptState *script) { +int KyraEngine_v1::o1_getIdolGem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getIdolGem(%p) (%d)", (const void *)script, stackPos(0)); return _idolGemsTable[stackPos(0)]; } -int KyraEngine_v1::o1_setIdolGem(ScriptState *script) { +int KyraEngine_v1::o1_setIdolGem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setIdolGem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _idolGemsTable[stackPos(0)] = stackPos(1); return 0; } -int KyraEngine_v1::o1_totalItemsInScene(ScriptState *script) { +int KyraEngine_v1::o1_totalItemsInScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_totalItemsInScene(%p) (%d)", (const void *)script, stackPos(0)); return countItemsInScene(stackPos(0)); } -int KyraEngine_v1::o1_restoreBrandonsMovementDelay(ScriptState *script) { +int KyraEngine_v1::o1_restoreBrandonsMovementDelay(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreBrandonsMovementDelay(%p) ()", (const void *)script); setWalkspeed(_configWalkspeed); return 0; } -int KyraEngine_v1::o1_setMousePos(ScriptState *script) { +int KyraEngine_v1::o1_setMousePos(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _system->warpMouse(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v1::o1_getMouseState(ScriptState *script) { +int KyraEngine_v1::o1_getMouseState(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getMouseState(%p) ()", (const void *)script); return _mouseState; } -int KyraEngine_v1::o1_setEntranceMouseCursorTrack(ScriptState *script) { +int KyraEngine_v1::o1_setEntranceMouseCursorTrack(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setEntranceMouseCursorTrack(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); _entranceMouseCursorTracks[0] = stackPos(0); _entranceMouseCursorTracks[1] = stackPos(1); @@ -1533,19 +1533,19 @@ int KyraEngine_v1::o1_setEntranceMouseCursorTrack(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_itemAppearsOnGround(ScriptState *script) { +int KyraEngine_v1::o1_itemAppearsOnGround(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_itemAppearsOnGround(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); processItemDrop(_currentCharacter->sceneId, stackPos(0), stackPos(1), stackPos(2), 2, 0); return 0; } -int KyraEngine_v1::o1_setNoDrawShapesFlag(ScriptState *script) { +int KyraEngine_v1::o1_setNoDrawShapesFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setNoDrawShapesFlag(%p) (%d)", (const void *)script, stackPos(0)); _animator->_noDrawShapesFlag = stackPos(0); return 0; } -int KyraEngine_v1::o1_fadeEntirePalette(ScriptState *script) { +int KyraEngine_v1::o1_fadeEntirePalette(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fadeEntirePalette(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); int cmd = stackPos(0); uint8 *fadePal = 0; @@ -1585,7 +1585,7 @@ int KyraEngine_v1::o1_fadeEntirePalette(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_itemOnGroundHere(ScriptState *script) { +int KyraEngine_v1::o1_itemOnGroundHere(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_itemOnGroundHere(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) < _roomTableSize); Room *curRoom = &_roomTable[stackPos(0)]; @@ -1596,18 +1596,18 @@ int KyraEngine_v1::o1_itemOnGroundHere(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_queryCauldronState(ScriptState *script) { +int KyraEngine_v1::o1_queryCauldronState(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryCauldronState(%p) ()", (const void *)script); return _cauldronState; } -int KyraEngine_v1::o1_setCauldronState(ScriptState *script) { +int KyraEngine_v1::o1_setCauldronState(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCauldronState(%p) (%d)", (const void *)script, stackPos(0)); _cauldronState = stackPos(0); return _cauldronState; } -int KyraEngine_v1::o1_queryCrystalState(ScriptState *script) { +int KyraEngine_v1::o1_queryCrystalState(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryCrystalState(%p) (%d)", (const void *)script, stackPos(0)); if (!stackPos(0)) return _crystalState[0]; @@ -1616,7 +1616,7 @@ int KyraEngine_v1::o1_queryCrystalState(ScriptState *script) { return -1; } -int KyraEngine_v1::o1_setCrystalState(ScriptState *script) { +int KyraEngine_v1::o1_setCrystalState(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCrystalState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); if (!stackPos(0)) _crystalState[0] = stackPos(1); @@ -1625,12 +1625,12 @@ int KyraEngine_v1::o1_setCrystalState(ScriptState *script) { return stackPos(1); } -int KyraEngine_v1::o1_setPaletteRange(ScriptState *script) { +int KyraEngine_v1::o1_setPaletteRange(EMCState *script) { warning("STUB: o1_setPaletteRange"); return 0; } -int KyraEngine_v1::o1_shrinkBrandonDown(ScriptState *script) { +int KyraEngine_v1::o1_shrinkBrandonDown(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_shrinkBrandonDown(%p) (%d)", (const void *)script, stackPos(0)); int delayTime = stackPos(0); checkAmuletAnimFlags(); @@ -1656,7 +1656,7 @@ int KyraEngine_v1::o1_shrinkBrandonDown(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_growBrandonUp(ScriptState *script) { +int KyraEngine_v1::o1_growBrandonUp(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_growBrandonUp(%p) ()", (const void *)script); int scaleValue = _scaleTable[_currentCharacter->y1]; int scale = 0; @@ -1677,33 +1677,33 @@ int KyraEngine_v1::o1_growBrandonUp(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_setBrandonScaleXAndY(ScriptState *script) { +int KyraEngine_v1::o1_setBrandonScaleXAndY(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBrandonScaleXAndY(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _animator->_brandonScaleX = stackPos(0); _animator->_brandonScaleY = stackPos(1); return 0; } -int KyraEngine_v1::o1_resetScaleMode(ScriptState *script) { +int KyraEngine_v1::o1_resetScaleMode(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_resetScaleMode(%p) ()", (const void *)script); _scaleMode = 0; return 0; } -int KyraEngine_v1::o1_getScaleDepthTableValue(ScriptState *script) { +int KyraEngine_v1::o1_getScaleDepthTableValue(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getScaleDepthTableValue(%p) (%d)", (const void *)script, stackPos(0)); assert(stackPos(0) < ARRAYSIZE(_scaleTable)); return _scaleTable[stackPos(0)]; } -int KyraEngine_v1::o1_setScaleDepthTableValue(ScriptState *script) { +int KyraEngine_v1::o1_setScaleDepthTableValue(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScaleDepthTableValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) < ARRAYSIZE(_scaleTable)); _scaleTable[stackPos(0)] = stackPos(1); return stackPos(1); } -int KyraEngine_v1::o1_message(ScriptState *script) { +int KyraEngine_v1::o1_message(EMCState *script) { if (_flags.isTalkie) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_message(%p) (%d, '%s', %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2)); drawSentenceCommand(stackPosString(1), stackPos(2)); @@ -1715,65 +1715,65 @@ int KyraEngine_v1::o1_message(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_checkClickOnNPC(ScriptState *script) { +int KyraEngine_v1::o1_checkClickOnNPC(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_checkClickOnNPC(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return checkForNPCScriptRun(stackPos(0), stackPos(1)); } -int KyraEngine_v1::o1_getFoyerItem(ScriptState *script) { +int KyraEngine_v1::o1_getFoyerItem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getFoyerItem(%p) (%d)", (const void *)script, stackPos(0)); assert(stackPos(0) < ARRAYSIZE(_foyerItemTable)); return _foyerItemTable[stackPos(0)]; } -int KyraEngine_v1::o1_setFoyerItem(ScriptState *script) { +int KyraEngine_v1::o1_setFoyerItem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setFoyerItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) < ARRAYSIZE(_foyerItemTable)); _foyerItemTable[stackPos(0)] = stackPos(1); return stackPos(1); } -int KyraEngine_v1::o1_setNoItemDropRegion(ScriptState *script) { +int KyraEngine_v1::o1_setNoItemDropRegion(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setNoItemDropRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); addToNoDropRects(stackPos(0), stackPos(1), stackPos(2), stackPos(3)); return 0; } -int KyraEngine_v1::o1_walkMalcolmOn(ScriptState *script) { +int KyraEngine_v1::o1_walkMalcolmOn(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkMalcolmOn(%p) ()", (const void *)script); if (!_malcolmFlag) _malcolmFlag = 1; return 0; } -int KyraEngine_v1::o1_passiveProtection(ScriptState *script) { +int KyraEngine_v1::o1_passiveProtection(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_passiveProtection(%p) ()", (const void *)script); return 1; } -int KyraEngine_v1::o1_setPlayingLoop(ScriptState *script) { +int KyraEngine_v1::o1_setPlayingLoop(EMCState *script) { warning("STUB: o1_setPlayingLoop"); return 0; } -int KyraEngine_v1::o1_brandonToStoneSequence(ScriptState *script) { +int KyraEngine_v1::o1_brandonToStoneSequence(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_brandonToStoneSequence(%p) ()", (const void *)script); seq_brandonToStone(); return 0; } -int KyraEngine_v1::o1_brandonHealingSequence(ScriptState *script) { +int KyraEngine_v1::o1_brandonHealingSequence(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_brandonHealingSequence(%p) ()", (const void *)script); seq_brandonHealing(); return 0; } -int KyraEngine_v1::o1_protectCommandLine(ScriptState *script) { +int KyraEngine_v1::o1_protectCommandLine(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_protectCommandLine(%p) (%d)", (const void *)script, stackPos(0)); return stackPos(0); } -int KyraEngine_v1::o1_pauseMusicSeconds(ScriptState *script) { +int KyraEngine_v1::o1_pauseMusicSeconds(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseMusicSeconds(%p) ()", (const void *)script); // if music disabled // return @@ -1781,18 +1781,18 @@ int KyraEngine_v1::o1_pauseMusicSeconds(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_resetMaskRegion(ScriptState *script) { +int KyraEngine_v1::o1_resetMaskRegion(EMCState *script) { warning("STUB: o1_resetMaskRegion"); return 0; } -int KyraEngine_v1::o1_setPaletteChangeFlag(ScriptState *script) { +int KyraEngine_v1::o1_setPaletteChangeFlag(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setPaletteChangeFlag(%p) (%d)", (const void *)script, stackPos(0)); _paletteChanged = stackPos(0); return _paletteChanged; } -int KyraEngine_v1::o1_fillRect(ScriptState *script) { +int KyraEngine_v1::o1_fillRect(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fillRect(%p) (%d, %d, %d, %d, %d, 0x%X)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); int videoPageBackup = _screen->_curPage; _screen->_curPage = stackPos(0); @@ -1801,26 +1801,26 @@ int KyraEngine_v1::o1_fillRect(ScriptState *script) { return 0; } -int KyraEngine_v1::o1_vocUnload(ScriptState *script) { +int KyraEngine_v1::o1_vocUnload(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_vocUnload(%p) ()", (const void *)script); // this should unload all voc files (not needed) return 0; } -int KyraEngine_v1::o1_vocLoad(ScriptState *script) { +int KyraEngine_v1::o1_vocLoad(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_vocLoad(%p) (%d)", (const void *)script, stackPos(0)); // this should load the specified voc file (not needed) return 0; } -int KyraEngine_v1::o1_dummy(ScriptState *script) { +int KyraEngine_v1::o1_dummy(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dummy(%p) ()", (const void *)script); return 0; } #pragma mark - -typedef Common::Functor1Mem<ScriptState*, int, KyraEngine_v1> OpcodeV1; +typedef Common::Functor1Mem<EMCState*, int, KyraEngine_v1> OpcodeV1; #define SetOpcodeTable(x) table = &x; #define Opcode(x) table->push_back(new OpcodeV1(this, &KyraEngine_v1::x)) void KyraEngine_v1::setupOpcodeTable() { |