[Scummvm-cvs-logs] SF.net SVN: scummvm: [21417] scummvm/trunk/engines/simon
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Wed Mar 22 20:50:02 CET 2006
Revision: 21417
Author: kirben
Date: 2006-03-22 20:49:03 -0800 (Wed, 22 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21417&view=rev
Log Message:
-----------
Minor changes for FF and cleanup
Modified Paths:
--------------
scummvm/trunk/engines/simon/simon.cpp
scummvm/trunk/engines/simon/simon.h
scummvm/trunk/engines/simon/vga.cpp
Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp 2006-03-23 04:41:06 UTC (rev 21416)
+++ scummvm/trunk/engines/simon/simon.cpp 2006-03-23 04:49:03 UTC (rev 21417)
@@ -327,7 +327,7 @@
_fastFadeOutFlag = 0;
_unkPalFlag = 0;
_exitCutscene = 0;
- _skipSpeech = 0;
+ _rightClick = 0;
_paletteFlag = 0;
_soundFileId = 0;
@@ -351,7 +351,7 @@
_curVgaFile2 = 0;
_curSfxFile = 0;
- _timer1 = 0;
+ _syncCount = 0;
_timer5 = 0;
_timer4 = 0;
@@ -2655,11 +2655,11 @@
void SimonEngine::o_waitForSync(uint a) {
_vgaWaitFor = a;
- _timer1 = 0;
+ _syncCount = 0;
_exitCutscene = false;
- _skipSpeech = false;
+ _rightClick = false;
while (_vgaWaitFor != 0) {
- if (_skipSpeech && (getGameType() == GType_SIMON2 || getGameType() == GType_FF)) {
+ if (_rightClick && (getGameType() == GType_SIMON2 || getGameType() == GType_FF)) {
if (_vgaWaitFor == 200 && !vcGetBit(14)) {
skipSpeech();
break;
@@ -2676,11 +2676,11 @@
delay(10);
if (getGameType() == GType_SIMON2) {
- if (_timer1 >= 1000) {
+ if (_syncCount >= 1000) {
warning("wait timed out");
break;
}
- } else if (_timer1 >= 500) {
+ } else if (_syncCount >= 500) {
warning("wait timed out");
break;
}
@@ -2824,7 +2824,7 @@
if (_lockWord & 0x80E9 || _lockWord & 2)
return;
- _timer1++;
+ _syncCount++;
_lockWord |= 2;
@@ -4136,7 +4136,7 @@
if (getGameType() == GType_FF)
_bitArray[5] &= ~0x1000;
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)
- _skipSpeech = true;
+ _rightClick = true;
else
_exitCutscene = true;
break;
Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h 2006-03-23 04:41:06 UTC (rev 21416)
+++ scummvm/trunk/engines/simon/simon.h 2006-03-23 04:49:03 UTC (rev 21417)
@@ -316,7 +316,7 @@
bool _fastFadeOutFlag;
bool _unkPalFlag;
bool _exitCutscene;
- bool _skipSpeech;
+ bool _rightClick;
byte _paletteFlag;
uint _soundFileId;
@@ -337,7 +337,7 @@
byte *_curVgaFile2;
byte *_curSfxFile;
- uint16 _timer1, _timer5, _timer4;
+ uint16 _syncCount, _timer5, _timer4;
uint16 _frameRate;
Modified: scummvm/trunk/engines/simon/vga.cpp
===================================================================
--- scummvm/trunk/engines/simon/vga.cpp 2006-03-23 04:41:06 UTC (rev 21416)
+++ scummvm/trunk/engines/simon/vga.cpp 2006-03-23 04:49:03 UTC (rev 21417)
@@ -684,8 +684,6 @@
if (state.image < 0)
state.image = vcReadVar(-state.image);
- debug(1, "vc10_draw: image %d palette %d x %d y %d flags 0x0%x\n", state.image, state.palette, state.x, state.y, state.flags);
-
p2 = _curVgaFile2 + state.image * 8;
if (getGameType() == GType_FF) {
state.depack_src = _curVgaFile2 + READ_LE_UINT32(p2);
@@ -693,7 +691,8 @@
height = READ_LE_UINT16(p2 + 4) & 0x7FFF;
flags = p2[5];
- debug(1, "Width %d Height %d Flags 0x%x", width, height, flags);
+ debug(1, "vc10_draw: image %d palette %d x %d y %d drawFlags 0x0%x\n", state.image, state.palette, state.x, state.y, state.flags);
+ debug(1, "vc10_draw: width %d height %d flags 0x%x", width, height, flags);
} else {
state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2);
width = READ_BE_UINT16(p2 + 6) / 16;
@@ -917,12 +916,17 @@
if (drawImages_clip(state) == 0)
return;
- state->surf2_addr += state->x + state->y * state->surf2_pitch;
state->surf_addr += state->x + state->y * state->surf_pitch;
uint w, h;
byte *src, *dst, *dst_org;
+ state->dl = state->width;
+ state->dh = state->height;
+
+ vc10_skip_cols(state);
+
+
if (state->flags & kDFMasked) {
if (vcGetBit(81) == false) {
if (state->x > _feebleRect.right)
@@ -935,11 +939,6 @@
return;
}
- state->dl = state->width;
- state->dh = state->height;
-
- vc10_skip_cols(state);
-
dst_org = state->surf_addr;
w = 0;
do {
@@ -959,11 +958,6 @@
dst_org++;
} while (++w != state->draw_width);
} else {
- state->dl = state->width;
- state->dh = state->height;
-
- vc10_skip_cols(state);
-
dst_org = state->surf_addr;
w = 0;
do {
@@ -988,7 +982,6 @@
if (drawImages_clip(state) == 0)
return;
- state->surf2_addr += state->x + state->y * state->surf2_pitch;
state->surf_addr += state->x + state->y * state->surf_pitch;
const byte *src;
@@ -1047,7 +1040,7 @@
_variableArray[22] = _feebleRect.bottom;
_variableArray[23] = _feebleRect.right;
- debug(0, "Left %d Right %d Top %d Bottom %d", dstRect.left, dstRect.right, dstRect.top, dstRect.bottom);
+ debug(1, "Left %d Right %d Top %d Bottom %d", dstRect.left, dstRect.right, dstRect.top, dstRect.bottom);
// Unlike normal rectangles in ScummVM, it seems that in the case of
// the destination rectangle the bottom and right coordinates are
@@ -1616,6 +1609,9 @@
vcWriteVar(254, 0);
+ if (getGameType() == GType_FF)
+ vcWriteVar(42, 1);
+
_lockWord &= ~8;
}
@@ -1870,12 +1866,12 @@
}
void SimonEngine::vcSetBitTo(uint bit, bool value) {
- uint16 *bits = &_bitArray[bit >> 4];
+ uint16 *bits = &_bitArray[bit / 16];
*bits = (*bits & ~(1 << (bit & 15))) | (value << (bit & 15));
}
bool SimonEngine::vcGetBit(uint bit) {
- uint16 *bits = &_bitArray[bit >> 4];
+ uint16 *bits = &_bitArray[bit / 16];
return (*bits & (1 << (bit & 15))) != 0;
}
@@ -2063,7 +2059,7 @@
vsp->x += vcReadNextWord();
vsp->y += vcReadNextWord();
- vsp->flags = 0x24;
+ vsp->flags = kDFMasked | 0x4;
_vgaSpriteChanged++;
}
@@ -2269,13 +2265,25 @@
}
void SimonEngine::vc73_setMark() {
- vcReadNextByte();
- _marks |= 1 << vcReadNextByte();
+ uint16 bit;
+
+ if (getGameType() == GType_FF)
+ bit = vcReadNextWord();
+ else
+ bit = vcReadNextByte();
+
+ _marks |= 1 << bit;
}
void SimonEngine::vc74_clearMark() {
- vcReadNextByte();
- _marks &= ~(1 << vcReadNextByte());
+ uint16 bit;
+
+ if (getGameType() == GType_FF)
+ bit = vcReadNextWord();
+ else
+ bit = vcReadNextByte();
+
+ _marks &= ~(1 << bit);
}
int SimonEngine::getScale(int y, int x) {
@@ -2320,7 +2328,7 @@
// TODO: Scroll check
}
- vsp->flags = 0x40;
+ vsp->flags = kDFScaled;
}
void SimonEngine::vc77_setScaleYOffs() {
@@ -2332,7 +2340,7 @@
vsp->y += getScale(vsp->y, x);
_variableArray[var] = vsp->y;
- vsp->flags = 0x40;
+ vsp->flags = kDFScaled;
}
void SimonEngine::vc78_computeXY() {
@@ -2379,7 +2387,7 @@
vsp->x += vcReadNextWord();
vsp->y += vcReadNextWord();
- vsp->flags = 0x10;
+ vsp->flags = kDFOverlayed;
_vgaSpriteChanged++;
}
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