aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2008-05-12 12:57:42 +0000
committerJohannes Schickel2008-05-12 12:57:42 +0000
commit1a52c5283a982350702a68f7aa4b66100711f1c3 (patch)
tree57dc5bceb2d1750b4d351c2d6950097db0f34f5c /engines
parent279987c181b5c5e6d6810c3f23a63eab5fb4c999 (diff)
downloadscummvm-rg350-1a52c5283a982350702a68f7aa4b66100711f1c3.tar.gz
scummvm-rg350-1a52c5283a982350702a68f7aa4b66100711f1c3.tar.bz2
scummvm-rg350-1a52c5283a982350702a68f7aa4b66100711f1c3.zip
- Yet more opcodes moved to KyraEngine_v1
- Renamed some opcodes inside KyraEngine_LoK svn-id: r32055
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/gui_lok.cpp2
-rw-r--r--engines/kyra/kyra_lok.cpp5
-rw-r--r--engines/kyra/kyra_lok.h10
-rw-r--r--engines/kyra/kyra_v1.cpp1
-rw-r--r--engines/kyra/kyra_v1.h5
-rw-r--r--engines/kyra/kyra_v2.h3
-rw-r--r--engines/kyra/script_hof.cpp4
-rw-r--r--engines/kyra/script_lok.cpp40
-rw-r--r--engines/kyra/script_mr.cpp4
-rw-r--r--engines/kyra/script_v1.cpp12
-rw-r--r--engines/kyra/script_v2.cpp12
11 files changed, 43 insertions, 55 deletions
diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp
index feacde683c..2b823b1ae7 100644
--- a/engines/kyra/gui_lok.cpp
+++ b/engines/kyra/gui_lok.cpp
@@ -423,7 +423,7 @@ int GUI_LoK::buttonMenuCallback(Button *caller) {
*/
setGUILabels();
- if (_vm->_currentCharacter->sceneId == 210 && _vm->_deathHandler == 0xFF) {
+ if (_vm->_currentCharacter->sceneId == 210 && _vm->_deathHandler == -1) {
_vm->snd_playSoundEffect(0x36);
return 0;
}
diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp
index 6636b8ba6d..0668cc7202 100644
--- a/engines/kyra/kyra_lok.cpp
+++ b/engines/kyra/kyra_lok.cpp
@@ -229,7 +229,6 @@ int KyraEngine_LoK::init() {
_brandonStatusBit = 0;
_brandonStatusBit0x02Flag = _brandonStatusBit0x20Flag = 10;
_brandonPosX = _brandonPosY = -1;
- _deathHandler = 0xFF;
_poisonDeathCounter = 0;
memset(_itemTable, 0, sizeof(_itemTable));
@@ -409,7 +408,7 @@ void KyraEngine_LoK::mainLoop() {
break;
}
- if (_deathHandler != 0xFF) {
+ if (_deathHandler != -1) {
snd_playWanderScoreViaMap(0, 1);
snd_playSoundEffect(49);
_screen->hideMouse();
@@ -417,7 +416,7 @@ void KyraEngine_LoK::mainLoop() {
removeHandItem();
_screen->showMouse();
_gui->buttonMenuCallback(0);
- _deathHandler = 0xFF;
+ _deathHandler = -1;
}
if ((_brandonStatusBit & 2) && _brandonStatusBit0x02Flag)
diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h
index cb63f8ef2f..4e68a9da22 100644
--- a/engines/kyra/kyra_lok.h
+++ b/engines/kyra/kyra_lok.h
@@ -435,7 +435,6 @@ protected:
uint8 _brandonStatusBit0x02Flag;
uint8 _brandonStatusBit0x20Flag;
uint8 _brandonPoisonFlagsGFX[256];
- uint8 _deathHandler;
int16 _brandonInvFlag;
uint8 _poisonDeathCounter;
int _brandonPosX;
@@ -671,8 +670,7 @@ protected:
int o1_mouseIsPointer(EMCState *script);
int o1_runSceneAnimUntilDone(EMCState *script);
int o1_fadeSpecialPalette(EMCState *script);
- int o1_playAdlibSound(EMCState *script);
- int o1_playAdlibScore(EMCState *script);
+ int o1_playSoundEffect(EMCState *script);
int o1_phaseInSameScene(EMCState *script);
int o1_setScenePhasingFlag(EMCState *script);
int o1_resetScenePhasingFlag(EMCState *script);
@@ -682,7 +680,7 @@ protected:
int o1_placeItemInGenericMapScene(EMCState *script);
int o1_setBrandonStatusBit(EMCState *script);
int o1_pauseSeconds(EMCState *script);
- int o1_getCharactersLocation(EMCState *script);
+ int o1_getCharacterScene(EMCState *script);
int o1_runNPCSubscript(EMCState *script);
int o1_magicOutMouseItem(EMCState *script);
int o1_internalAnimOn(EMCState *script);
@@ -704,13 +702,13 @@ protected:
int o1_restoreCustomPrintBackground(EMCState *script);
int o1_getCharacterX(EMCState *script);
int o1_getCharacterY(EMCState *script);
- int o1_changeCharactersFacing(EMCState *script);
+ int o1_setCharacterFacing(EMCState *script);
int o1_copyWSARegion(EMCState *script);
int o1_printText(EMCState *script);
int o1_loadSoundFile(EMCState *script);
int o1_displayWSAFrameOnHidPage(EMCState *script);
int o1_displayWSASequentialFrames(EMCState *script);
- int o1_drawCharacterStanding(EMCState *script);
+ int o1_refreshCharacter(EMCState *script);
int o1_internalAnimOff(EMCState *script);
int o1_changeCharactersXAndY(EMCState *script);
int o1_clearSceneAnimatorBeacon(EMCState *script);
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 76b68d5164..a3d18f7713 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -63,6 +63,7 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
_gameToLoad = -1;
_mouseState = -1;
+ _deathHandler = -1;
memset(_flagsTable, 0, sizeof(_flagsTable));
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 1b410d1907..0a7bf40a12 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -199,6 +199,9 @@ protected:
uint16 _tickLength;
uint16 _gameSpeed;
+ // run
+ int8 _deathHandler;
+
// timer
virtual void setupTimers() = 0;
@@ -222,6 +225,8 @@ protected:
int o1_setHandItem(EMCState *script);
int o1_removeHandItem(EMCState *script);
int o1_getMouseState(EMCState *script);
+ int o1_setDeathHandler(EMCState *script);
+ int o1_playWanderScoreViaMap(EMCState *script);
// items
int _mouseState;
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index 44eb06ce57..2f6d8a6185 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -87,7 +87,6 @@ protected:
// run
bool _runFlag;
bool _showOutro;
- int8 _deathHandler;
virtual void update() = 0;
virtual void updateWithText() = 0;
@@ -396,8 +395,6 @@ protected:
int o2_delay(EMCState *script);
int o2_update(EMCState *script);
int o2_getShapeFlag1(EMCState *script);
- int o2_playWanderScoreViaMap(EMCState *script);
- int o2_setDeathHandler(EMCState *script);
int o2_waitForConfirmationClick(EMCState *script);
int o2_randomSceneChat(EMCState *script);
int o2_setDlgIndex(EMCState *script);
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index b6835ab044..00dcc1fe6a 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -1622,7 +1622,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_setZanthiaPos);
Opcode(o2_loadMusicTrack);
// 0x58
- Opcode(o2_playWanderScoreViaMap);
+ Opcode(o1_playWanderScoreViaMap);
Opcode(o2_playSoundEffect);
Opcode(o2_setSceneAnimPos);
Opcode(o2_blockInRegion);
@@ -1634,7 +1634,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
// 0x60
Opcode(o1_getRand);
Opcode(o2_isAnySoundPlaying);
- Opcode(o2_setDeathHandler);
+ Opcode(o1_setDeathHandler);
Opcode(o2_setDrawNoShapeFlag);
// 0x64
Opcode(o2_setRunFlag);
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
index f944e59b4a..6016feff0f 100644
--- a/engines/kyra/script_lok.cpp
+++ b/engines/kyra/script_lok.cpp
@@ -256,18 +256,12 @@ int KyraEngine_LoK::o1_fadeSpecialPalette(EMCState *script) {
return 0;
}
-int KyraEngine_LoK::o1_playAdlibSound(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_playAdlibSound(%p) (%d)", (const void *)script, stackPos(0));
+int KyraEngine_LoK::o1_playSoundEffect(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0));
snd_playSoundEffect(stackPos(0));
return 0;
}
-int KyraEngine_LoK::o1_playAdlibScore(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_playAdlibScore(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
- return 0;
-}
-
int KyraEngine_LoK::o1_phaseInSameScene(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_phaseInSameScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
transcendScenes(stackPos(0), stackPos(1));
@@ -351,8 +345,8 @@ int KyraEngine_LoK::o1_pauseSeconds(EMCState *script) {
return 0;
}
-int KyraEngine_LoK::o1_getCharactersLocation(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getCharactersLocation(%p) (%d)", (const void *)script, stackPos(0));
+int KyraEngine_LoK::o1_getCharacterScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getCharacterScene(%p) (%d)", (const void *)script, stackPos(0));
return _characterList[stackPos(0)].sceneId;
}
@@ -648,8 +642,8 @@ int KyraEngine_LoK::o1_getCharacterY(EMCState *script) {
return _characterList[stackPos(0)].y1;
}
-int KyraEngine_LoK::o1_changeCharactersFacing(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_changeCharactersFacing(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+int KyraEngine_LoK::o1_setCharacterFacing(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCharacterFacing(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
int character = stackPos(0);
int facing = stackPos(1);
int newAnimFrame = stackPos(2);
@@ -799,8 +793,8 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
return 0;
}
-int KyraEngine_LoK::o1_drawCharacterStanding(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_drawCharacterStanding(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+int KyraEngine_LoK::o1_refreshCharacter(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_refreshCharacter(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int character = stackPos(0);
int animFrame = stackPos(1);
int newFacing = stackPos(2);
@@ -1230,12 +1224,6 @@ int KyraEngine_LoK::o1_setFireberryGlowPalette(EMCState *script) {
return 0;
}
-int KyraEngine_LoK::o1_setDeathHandlerFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setDeathHandlerFlag(%p) (%d)", (const void *)script, stackPos(0));
- _deathHandler = stackPos(0);
- return 0;
-}
-
int KyraEngine_LoK::o1_drinkPotionAnimation(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_drinkPotionAnimation(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
seq_playDrinkPotionAnim(stackPos(0), stackPos(1), stackPos(2));
@@ -1800,9 +1788,9 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_removeHandItem);
Opcode(o1_runSceneAnimUntilDone);
Opcode(o1_fadeSpecialPalette);
- Opcode(o1_playAdlibSound);
+ Opcode(o1_playSoundEffect);
// 0x18
- Opcode(o1_playAdlibScore);
+ Opcode(o1_playWanderScoreViaMap);
Opcode(o1_phaseInSameScene);
Opcode(o1_setScenePhasingFlag);
Opcode(o1_resetScenePhasingFlag);
@@ -1814,7 +1802,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
// 0x20
Opcode(o1_setBrandonStatusBit);
Opcode(o1_pauseSeconds);
- Opcode(o1_getCharactersLocation);
+ Opcode(o1_getCharacterScene);
Opcode(o1_runNPCSubscript);
// 0x24
Opcode(o1_magicOutMouseItem);
@@ -1844,7 +1832,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
// 0x38
Opcode(o1_getCharacterX);
Opcode(o1_getCharacterY);
- Opcode(o1_changeCharactersFacing);
+ Opcode(o1_setCharacterFacing);
Opcode(o1_copyWSARegion);
// 0x3c
Opcode(o1_printText);
@@ -1853,7 +1841,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_displayWSAFrameOnHidPage);
// 0x40
Opcode(o1_displayWSASequentialFrames);
- Opcode(o1_drawCharacterStanding);
+ Opcode(o1_refreshCharacter);
Opcode(o1_internalAnimOff);
Opcode(o1_changeCharactersXAndY);
// 0x44
@@ -1890,7 +1878,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_dispelMagicAnimation);
Opcode(o1_findBrightestFireberry);
Opcode(o1_setFireberryGlowPalette);
- Opcode(o1_setDeathHandlerFlag);
+ Opcode(o1_setDeathHandler);
// 0x60
Opcode(o1_drinkPotionAnimation);
Opcode(o1_makeAmuletAppear);
diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp
index af0bde24c1..965a727071 100644
--- a/engines/kyra/script_mr.cpp
+++ b/engines/kyra/script_mr.cpp
@@ -1261,7 +1261,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_setMalcolmPos);
Opcode(o3_stopMusic);
// 0x58
- Opcode(o2_playWanderScoreViaMap);
+ Opcode(o1_playWanderScoreViaMap);
Opcode(o3_playSoundEffect);
Opcode(o3_getScore);
Opcode(o3_daggerWarning);
@@ -1273,7 +1273,7 @@ void KyraEngine_MR::setupOpcodeTable() {
// 0x60
Opcode(o1_getRand);
Opcode(o3_dummy);
- Opcode(o2_setDeathHandler);
+ Opcode(o1_setDeathHandler);
Opcode(o3_showGoodConscience);
// 0x64
Opcode(o3_goodConscienceChat);
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp
index 40c82ff00a..80678db32d 100644
--- a/engines/kyra/script_v1.cpp
+++ b/engines/kyra/script_v1.cpp
@@ -84,5 +84,17 @@ int KyraEngine_v1::o1_getMouseState(EMCState *script) {
return _mouseState;
}
+int KyraEngine_v1::o1_setDeathHandler(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setDeathHandler(%p) (%d)", (const void *)script, stackPos(0));
+ _deathHandler = stackPos(0);
+ return 0;
+}
+
+int KyraEngine_v1::o1_playWanderScoreViaMap(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
+ return 0;
+}
+
} // end of namespace Kyra
diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp
index 8c412cd560..2af4fda727 100644
--- a/engines/kyra/script_v2.cpp
+++ b/engines/kyra/script_v2.cpp
@@ -156,18 +156,6 @@ int KyraEngine_v2::o2_getShapeFlag1(EMCState *script) {
return screen()->getShapeFlag1(stackPos(0), stackPos(1));
}
-int KyraEngine_v2::o2_playWanderScoreViaMap(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_setDeathHandler(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDeathHandler(%p) (%d)", (const void *)script, stackPos(0));
- _deathHandler = stackPos(0);
- return 0;
-}
-
int KyraEngine_v2::o2_waitForConfirmationClick(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0));
resetSkipFlag();