[Scummvm-cvs-logs] SF.net SVN: scummvm:[52288] scummvm/trunk/engines/gob
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Mon Aug 23 01:11:29 CEST 2010
Revision: 52288
http://scummvm.svn.sourceforge.net/scummvm/?rev=52288&view=rev
Author: strangerke
Date: 2010-08-22 23:11:29 +0000 (Sun, 22 Aug 2010)
Log Message:
-----------
GOB - Fix 2 bugs in Fascination Hebrew, now playable.
Again, thanks SylvainTV for the debugging efforts
Modified Paths:
--------------
scummvm/trunk/engines/gob/inter.h
scummvm/trunk/engines/gob/inter_fascin.cpp
scummvm/trunk/engines/gob/scenery.cpp
Modified: scummvm/trunk/engines/gob/inter.h
===================================================================
--- scummvm/trunk/engines/gob/inter.h 2010-08-22 20:37:48 UTC (rev 52287)
+++ scummvm/trunk/engines/gob/inter.h 2010-08-22 23:11:29 UTC (rev 52288)
@@ -432,6 +432,7 @@
void oFascin_playProtracker(OpGobParams ¶ms);
+ bool oFascin_assign(OpFuncParams ¶ms);
bool oFascin_copySprite(OpFuncParams ¶ms);
bool oFascin_keyFunc(OpFuncParams ¶ms);
Modified: scummvm/trunk/engines/gob/inter_fascin.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_fascin.cpp 2010-08-22 20:37:48 UTC (rev 52287)
+++ scummvm/trunk/engines/gob/inter_fascin.cpp 2010-08-22 23:11:29 UTC (rev 52288)
@@ -33,6 +33,7 @@
#include "gob/dataio.h"
#include "gob/draw.h"
#include "gob/game.h"
+#include "gob/expression.h"
#include "gob/script.h"
#include "gob/palanim.h"
#include "gob/video.h"
@@ -87,7 +88,7 @@
void Inter_Fascination::setupOpcodesFunc() {
Inter_v2::setupOpcodesFunc();
- OPCODEFUNC(0x09, o1_assign);
+ OPCODEFUNC(0x09, oFascin_assign);
OPCODEFUNC(0x32, oFascin_copySprite);
}
@@ -112,7 +113,53 @@
OPCODEGOB(1002, o2_stopProtracker);
}
+bool Inter_Fascination::oFascin_assign(OpFuncParams ¶ms) {
+ byte destType = _vm->_game->_script->peekByte();
+ int16 dest = _vm->_game->_script->readVarIndex();
+ byte loopCount;
+ if (_vm->_game->_script->peekByte() == 99) {
+ _vm->_game->_script->skip(1);
+ loopCount = _vm->_game->_script->readByte();
+ } else
+ loopCount = 1;
+
+ for (int i = 0; i < loopCount; i++) {
+ int16 result;
+ int16 srcType = _vm->_game->_script->evalExpr(&result);
+
+ switch (destType) {
+ case TYPE_VAR_INT8: // 18
+ if (srcType != TYPE_IMM_INT16) { //20
+ char* str = _vm->_game->_script->getResultStr();
+ WRITE_VARO_STR(dest, str);
+ } else
+ WRITE_VARO_UINT8(dest + i, _vm->_game->_script->getResultInt());
+ break;
+
+ case TYPE_VAR_INT32_AS_INT16: // 24. Yes, it's really there
+ case TYPE_ARRAY_INT16: //27
+ WRITE_VARO_UINT16(dest + i * 2, _vm->_game->_script->getResultInt());
+ break;
+
+ case TYPE_VAR_INT32: // 23
+ case TYPE_ARRAY_INT32: // 26
+ WRITE_VAR_OFFSET(dest + i * 4, _vm->_game->_script->getResultInt()); // or *2 ?
+ break;
+
+ case TYPE_VAR_STR: // 25
+ case TYPE_ARRAY_STR: // 28
+ if (srcType == TYPE_IMM_INT16)
+ WRITE_VARO_UINT8(dest, result);
+ else
+ WRITE_VARO_STR(dest, _vm->_game->_script->getResultStr());
+ break;
+ }
+ }
+
+ return false;
+}
+
bool Inter_Fascination::oFascin_copySprite(OpFuncParams ¶ms) {
_vm->_draw->_sourceSurface = _vm->_game->_script->readInt16();
_vm->_draw->_destSurface = _vm->_game->_script->readInt16();
Modified: scummvm/trunk/engines/gob/scenery.cpp
===================================================================
--- scummvm/trunk/engines/gob/scenery.cpp 2010-08-22 20:37:48 UTC (rev 52287)
+++ scummvm/trunk/engines/gob/scenery.cpp 2010-08-22 23:11:29 UTC (rev 52288)
@@ -923,13 +923,24 @@
int16 varDX, int16 varDY, int16 varUnk0, int16 varFrames) {
assert(index < 10);
- assert(layer < _animations[index].layersCount);
- AnimLayer &animLayer = _animations[index].layers[layer];
- WRITE_VAR_OFFSET(varDX, animLayer.animDeltaX);
- WRITE_VAR_OFFSET(varDY, animLayer.animDeltaY);
- WRITE_VAR_OFFSET(varUnk0, animLayer.unknown0);
- WRITE_VAR_OFFSET(varFrames, animLayer.framesCount);
+// WORKAROUND - Fascination Hebrew is using scripts from the CD versions, but of course
+// no CD track, so the anim syncing failed, and the anims were suppressed. But they
+// didn't updated the scripts. Skipping the wrong anims is a solution.
+ if ((_vm->getGameType() == kGameTypeFascination) && (layer >= _animations[index].layersCount)) {
+ WRITE_VAR_OFFSET(varDX, 0);
+ WRITE_VAR_OFFSET(varDY, 0);
+ WRITE_VAR_OFFSET(varUnk0, 0);
+ WRITE_VAR_OFFSET(varFrames, 0);
+ } else {
+ assert(layer < _animations[index].layersCount);
+
+ AnimLayer &animLayer = _animations[index].layers[layer];
+ WRITE_VAR_OFFSET(varDX, animLayer.animDeltaX);
+ WRITE_VAR_OFFSET(varDY, animLayer.animDeltaY);
+ WRITE_VAR_OFFSET(varUnk0, animLayer.unknown0);
+ WRITE_VAR_OFFSET(varFrames, animLayer.framesCount);
+ }
}
int16 Scenery::getStaticLayersCount(uint16 index) {
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