2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2002-06-29 16:11:13 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-06-29 16:11:13 +00:00
|
|
|
*
|
2006-02-11 12:46:41 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2002-06-29 16:11:13 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Video script opcodes for Simon1/Simon2
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2006-04-29 14:23:16 +00:00
|
|
|
|
2006-09-29 08:14:27 +00:00
|
|
|
#include "agos/agos.h"
|
|
|
|
#include "agos/intern.h"
|
|
|
|
#include "agos/vga.h"
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2005-01-10 22:06:49 +00:00
|
|
|
#include "common/system.h"
|
|
|
|
|
2007-06-21 03:14:20 +00:00
|
|
|
#include "graphics/surface.h"
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
namespace AGOS {
|
2003-10-03 19:42:27 +00:00
|
|
|
|
2002-06-29 16:11:13 +00:00
|
|
|
// Opcode tables
|
2007-04-15 05:04:48 +00:00
|
|
|
void AGOSEngine::setupVideoOpcodes(VgaOpcodeProc *op) {
|
2006-10-02 14:32:28 +00:00
|
|
|
op[1] = &AGOSEngine::vc1_fadeOut;
|
|
|
|
op[2] = &AGOSEngine::vc2_call;
|
|
|
|
op[3] = &AGOSEngine::vc3_loadSprite;
|
|
|
|
op[4] = &AGOSEngine::vc4_fadeIn;
|
2006-10-27 12:55:48 +00:00
|
|
|
op[5] = &AGOSEngine::vc5_ifEqual;
|
|
|
|
op[6] = &AGOSEngine::vc6_ifObjectHere;
|
|
|
|
op[7] = &AGOSEngine::vc7_ifObjectNotHere;
|
|
|
|
op[8] = &AGOSEngine::vc8_ifObjectIsAt;
|
|
|
|
op[9] = &AGOSEngine::vc9_ifObjectStateIs;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[10] = &AGOSEngine::vc10_draw;
|
|
|
|
op[12] = &AGOSEngine::vc12_delay;
|
|
|
|
op[13] = &AGOSEngine::vc13_addToSpriteX;
|
|
|
|
op[14] = &AGOSEngine::vc14_addToSpriteY;
|
|
|
|
op[15] = &AGOSEngine::vc15_sync;
|
|
|
|
op[16] = &AGOSEngine::vc16_waitSync;
|
|
|
|
op[18] = &AGOSEngine::vc18_jump;
|
|
|
|
op[20] = &AGOSEngine::vc20_setRepeat;
|
|
|
|
op[21] = &AGOSEngine::vc21_endRepeat;
|
2006-10-13 13:16:15 +00:00
|
|
|
op[23] = &AGOSEngine::vc23_setPriority;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[24] = &AGOSEngine::vc24_setSpriteXY;
|
|
|
|
op[25] = &AGOSEngine::vc25_halt_sprite;
|
|
|
|
op[26] = &AGOSEngine::vc26_setSubWindow;
|
|
|
|
op[27] = &AGOSEngine::vc27_resetSprite;
|
|
|
|
op[29] = &AGOSEngine::vc29_stopAllSounds;
|
|
|
|
op[30] = &AGOSEngine::vc30_setFrameRate;
|
|
|
|
op[31] = &AGOSEngine::vc31_setWindow;
|
|
|
|
op[33] = &AGOSEngine::vc33_setMouseOn;
|
|
|
|
op[34] = &AGOSEngine::vc34_setMouseOff;
|
|
|
|
op[35] = &AGOSEngine::vc35_clearWindow;
|
|
|
|
op[36] = &AGOSEngine::vc36_setWindowImage;
|
2006-10-27 12:55:48 +00:00
|
|
|
op[38] = &AGOSEngine::vc38_ifVarNotZero;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[39] = &AGOSEngine::vc39_setVar;
|
2007-06-30 17:34:49 +00:00
|
|
|
op[40] = &AGOSEngine::vc40_scrollRight;
|
|
|
|
op[41] = &AGOSEngine::vc41_scrollLeft;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[42] = &AGOSEngine::vc42_delayIfNotEQ;
|
2006-10-27 12:55:48 +00:00
|
|
|
op[43] = &AGOSEngine::vc43_ifBitSet;
|
|
|
|
op[44] = &AGOSEngine::vc44_ifBitClear;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[45] = &AGOSEngine::vc45_setSpriteX;
|
|
|
|
op[46] = &AGOSEngine::vc46_setSpriteY;
|
|
|
|
op[47] = &AGOSEngine::vc47_addToVar;
|
|
|
|
op[49] = &AGOSEngine::vc49_setBit;
|
|
|
|
op[50] = &AGOSEngine::vc50_clearBit;
|
|
|
|
op[51] = &AGOSEngine::vc51_enableBox;
|
2006-10-13 13:16:15 +00:00
|
|
|
op[52] = &AGOSEngine::vc52_playSound;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[55] = &AGOSEngine::vc55_moveBox;
|
|
|
|
}
|
|
|
|
|
2007-04-15 05:04:48 +00:00
|
|
|
void AGOSEngine_Elvira1::setupVideoOpcodes(VgaOpcodeProc *op) {
|
2006-10-02 14:32:28 +00:00
|
|
|
op[1] = &AGOSEngine::vc1_fadeOut;
|
|
|
|
op[2] = &AGOSEngine::vc2_call;
|
|
|
|
op[3] = &AGOSEngine::vc3_loadSprite;
|
|
|
|
op[4] = &AGOSEngine::vc4_fadeIn;
|
2006-10-27 12:55:48 +00:00
|
|
|
op[5] = &AGOSEngine::vc5_ifEqual;
|
|
|
|
op[6] = &AGOSEngine::vc6_ifObjectHere;
|
|
|
|
op[7] = &AGOSEngine::vc7_ifObjectNotHere;
|
|
|
|
op[8] = &AGOSEngine::vc8_ifObjectIsAt;
|
|
|
|
op[9] = &AGOSEngine::vc9_ifObjectStateIs;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[10] = &AGOSEngine::vc10_draw;
|
|
|
|
op[13] = &AGOSEngine::vc12_delay;
|
|
|
|
op[14] = &AGOSEngine::vc13_addToSpriteX;
|
|
|
|
op[15] = &AGOSEngine::vc14_addToSpriteY;
|
|
|
|
op[16] = &AGOSEngine::vc15_sync;
|
|
|
|
op[17] = &AGOSEngine::vc16_waitSync;
|
2006-10-13 12:55:53 +00:00
|
|
|
op[18] = &AGOSEngine::vc17_waitEnd;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[19] = &AGOSEngine::vc18_jump;
|
2006-10-13 12:55:53 +00:00
|
|
|
op[20] = &AGOSEngine::vc19_loop;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[21] = &AGOSEngine::vc20_setRepeat;
|
|
|
|
op[22] = &AGOSEngine::vc21_endRepeat;
|
2006-10-13 13:16:15 +00:00
|
|
|
op[23] = &AGOSEngine::vc22_setPaletteOld;
|
|
|
|
op[24] = &AGOSEngine::vc23_setPriority;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[25] = &AGOSEngine::vc24_setSpriteXY;
|
|
|
|
op[26] = &AGOSEngine::vc25_halt_sprite;
|
|
|
|
op[27] = &AGOSEngine::vc26_setSubWindow;
|
|
|
|
op[28] = &AGOSEngine::vc27_resetSprite;
|
2006-10-13 12:55:53 +00:00
|
|
|
op[29] = &AGOSEngine::vc28_playSFX;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[30] = &AGOSEngine::vc29_stopAllSounds;
|
|
|
|
op[31] = &AGOSEngine::vc30_setFrameRate;
|
|
|
|
op[32] = &AGOSEngine::vc31_setWindow;
|
2006-10-13 12:55:53 +00:00
|
|
|
op[33] = &AGOSEngine::vc32_saveScreen;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[34] = &AGOSEngine::vc33_setMouseOn;
|
|
|
|
op[35] = &AGOSEngine::vc34_setMouseOff;
|
|
|
|
op[38] = &AGOSEngine::vc35_clearWindow;
|
|
|
|
op[40] = &AGOSEngine::vc36_setWindowImage;
|
2006-10-13 12:55:53 +00:00
|
|
|
op[41] = &AGOSEngine::vc37_pokePalette;
|
2006-10-27 12:55:48 +00:00
|
|
|
op[51] = &AGOSEngine::vc38_ifVarNotZero;
|
2006-10-02 14:32:28 +00:00
|
|
|
op[52] = &AGOSEngine::vc39_setVar;
|
2007-06-30 17:34:49 +00:00
|
|
|
op[53] = &AGOSEngine::vc40_scrollRight;
|
|
|
|
op[54] = &AGOSEngine::vc41_scrollLeft;
|
2006-10-28 05:34:40 +00:00
|
|
|
op[56] = &AGOSEngine::vc42_delayIfNotEQ;
|
2006-10-13 12:55:53 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::setupVgaOpcodes() {
|
2006-10-08 00:41:29 +00:00
|
|
|
memset(_vga_opcode_table, 0, sizeof(_vga_opcode_table));
|
2006-10-02 14:32:28 +00:00
|
|
|
|
|
|
|
switch (getGameType()) {
|
2009-03-08 08:45:21 +00:00
|
|
|
case GType_PN:
|
2006-10-06 05:13:09 +00:00
|
|
|
case GType_ELVIRA1:
|
2006-10-04 07:10:22 +00:00
|
|
|
case GType_ELVIRA2:
|
2006-10-02 14:32:28 +00:00
|
|
|
case GType_WW:
|
|
|
|
case GType_SIMON1:
|
|
|
|
case GType_SIMON2:
|
|
|
|
case GType_FF:
|
|
|
|
case GType_PP:
|
2007-04-15 05:04:48 +00:00
|
|
|
setupVideoOpcodes(_vga_opcode_table);
|
2006-10-02 14:32:28 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("setupVgaOpcodes: Unknown game");
|
|
|
|
}
|
2005-11-05 18:47:03 +00:00
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-27 12:55:48 +00:00
|
|
|
// VGA Script parser
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::runVgaScript() {
|
2002-07-07 19:06:48 +00:00
|
|
|
for (;;) {
|
2002-06-29 16:11:13 +00:00
|
|
|
uint opcode;
|
|
|
|
|
2009-02-07 03:36:36 +00:00
|
|
|
if (_dumpVgaOpcodes) {
|
|
|
|
if (_vcPtr != (const byte *)&_vcGetOutOfCode) {
|
2006-07-22 16:09:34 +00:00
|
|
|
printf("%.5d %.5X: %5d %4d ", _vgaTickCounter, (unsigned int)(_vcPtr - _curVgaFile1), _vgaCurSpriteId, _vgaCurZoneNum);
|
2006-10-06 08:30:07 +00:00
|
|
|
dumpVideoScript(_vcPtr, true);
|
2003-03-06 19:16:24 +00:00
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-30 02:15:02 +00:00
|
|
|
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) {
|
|
|
|
opcode = *_vcPtr++;
|
|
|
|
} else {
|
2005-05-06 11:37:33 +00:00
|
|
|
opcode = READ_BE_UINT16(_vcPtr);
|
|
|
|
_vcPtr += 2;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (opcode == 0)
|
|
|
|
return;
|
|
|
|
|
2006-10-02 14:32:28 +00:00
|
|
|
if (opcode >= _numVideoOpcodes || !_vga_opcode_table[opcode])
|
2009-03-08 10:08:09 +00:00
|
|
|
error("runVgaScript: Invalid VGA opcode '%d' encountered", opcode);
|
2006-10-02 14:32:28 +00:00
|
|
|
|
2005-11-05 18:47:03 +00:00
|
|
|
(this->*_vga_opcode_table[opcode]) ();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-07 01:11:51 +00:00
|
|
|
bool AGOSEngine::ifObjectHere(uint16 a) {
|
2006-04-29 12:25:15 +00:00
|
|
|
Item *item;
|
|
|
|
|
|
|
|
CHECK_BOUNDS(a, _objectArray);
|
|
|
|
|
|
|
|
item = _objectArray[a];
|
|
|
|
if (item == NULL)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return me()->parent == item->parent;
|
|
|
|
}
|
|
|
|
|
2009-02-07 01:11:51 +00:00
|
|
|
bool AGOSEngine::ifObjectAt(uint16 a, uint16 b) {
|
2006-04-29 12:25:15 +00:00
|
|
|
Item *item_a, *item_b;
|
|
|
|
|
|
|
|
CHECK_BOUNDS(a, _objectArray);
|
|
|
|
CHECK_BOUNDS(b, _objectArray);
|
|
|
|
|
|
|
|
item_a = _objectArray[a];
|
|
|
|
item_b = _objectArray[b];
|
|
|
|
|
|
|
|
if (item_a == NULL || item_b == NULL)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return derefItem(item_a->parent) == item_b;
|
|
|
|
}
|
|
|
|
|
2009-02-07 01:11:51 +00:00
|
|
|
bool AGOSEngine::ifObjectState(uint16 a, int16 b) {
|
2006-04-29 12:25:15 +00:00
|
|
|
Item *item;
|
|
|
|
|
|
|
|
CHECK_BOUNDS(a, _objectArray);
|
|
|
|
|
|
|
|
item = _objectArray[a];
|
|
|
|
if (item == NULL)
|
|
|
|
return true;
|
|
|
|
return item->state == b;
|
|
|
|
}
|
|
|
|
|
2007-05-09 15:36:05 +00:00
|
|
|
void AGOSEngine::dirtyBackGround() {
|
|
|
|
AnimTable *animTable = _screenAnim1;
|
|
|
|
while (animTable->srcPtr) {
|
2007-06-19 11:50:22 +00:00
|
|
|
if (animTable->id == _vgaCurSpriteId && animTable->zoneNum == _vgaCurZoneNum) {
|
2007-06-09 05:30:20 +00:00
|
|
|
animTable->windowNum |= 0x8000;
|
2007-05-09 15:36:05 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
animTable++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
VgaSprite *AGOSEngine::findCurSprite() {
|
2006-04-29 14:11:29 +00:00
|
|
|
VgaSprite *vsp = _vgaSprites;
|
|
|
|
while (vsp->id) {
|
2007-06-19 11:50:22 +00:00
|
|
|
if (vsp->id == _vgaCurSpriteId && vsp->zoneNum == _vgaCurZoneNum)
|
|
|
|
break;
|
2006-04-29 14:11:29 +00:00
|
|
|
vsp++;
|
|
|
|
}
|
|
|
|
return vsp;
|
|
|
|
}
|
|
|
|
|
2006-11-05 06:26:45 +00:00
|
|
|
bool AGOSEngine::isSpriteLoaded(uint16 id, uint16 zoneNum) {
|
|
|
|
VgaSprite *vsp = _vgaSprites;
|
|
|
|
while (vsp->id) {
|
2007-06-19 11:50:22 +00:00
|
|
|
if (vsp->id == id && vsp->zoneNum == zoneNum)
|
|
|
|
return true;
|
2006-11-05 06:26:45 +00:00
|
|
|
vsp++;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2006-10-27 12:55:48 +00:00
|
|
|
bool AGOSEngine::getBitFlag(uint bit) {
|
|
|
|
uint16 *bits = &_bitArray[bit / 16];
|
|
|
|
return (*bits & (1 << (bit & 15))) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AGOSEngine::setBitFlag(uint bit, bool value) {
|
|
|
|
uint16 *bits = &_bitArray[bit / 16];
|
|
|
|
*bits = (*bits & ~(1 << (bit & 15))) | (value << (bit & 15));
|
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
int AGOSEngine::vcReadVarOrWord() {
|
2009-03-08 08:45:21 +00:00
|
|
|
if (getGameType() == GType_PN || getGameType() == GType_ELVIRA1) {
|
2006-10-03 00:31:24 +00:00
|
|
|
return vcReadNextWord();
|
|
|
|
} else {
|
|
|
|
int16 var = vcReadNextWord();
|
|
|
|
if (var < 0)
|
|
|
|
var = vcReadVar(-var);
|
|
|
|
return var;
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
uint AGOSEngine::vcReadNextWord() {
|
2005-10-07 06:59:49 +00:00
|
|
|
uint a;
|
2005-10-12 00:35:54 +00:00
|
|
|
a = readUint16Wrapper(_vcPtr);
|
2005-05-06 11:37:33 +00:00
|
|
|
_vcPtr += 2;
|
2002-06-29 16:11:13 +00:00
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
uint AGOSEngine::vcReadNextByte() {
|
2005-05-06 11:37:33 +00:00
|
|
|
return *_vcPtr++;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
uint AGOSEngine::vcReadVar(uint var) {
|
2006-09-29 00:50:22 +00:00
|
|
|
assert(var < _numVars);
|
2006-04-24 10:35:57 +00:00
|
|
|
return (uint16)_variableArrayPtr[var];
|
2006-04-15 01:09:04 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vcWriteVar(uint var, int16 value) {
|
2006-09-29 00:50:22 +00:00
|
|
|
assert(var < _numVars);
|
2006-04-15 22:14:39 +00:00
|
|
|
_variableArrayPtr[var] = value;
|
2006-04-15 01:09:04 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vcSkipNextInstruction() {
|
2006-09-30 02:15:02 +00:00
|
|
|
|
2009-03-08 08:45:21 +00:00
|
|
|
static const byte opcodeParamLenPN[] = {
|
|
|
|
0, 6, 2, 10, 6, 4, 2, 2,
|
|
|
|
4, 4, 8, 2, 0, 2, 2, 2,
|
|
|
|
0, 2, 2, 2, 0, 4, 2, 2,
|
|
|
|
2, 8, 0, 10, 0, 8, 0, 2,
|
|
|
|
2, 0, 0, 0, 0, 2, 4, 2,
|
|
|
|
4, 4, 0, 0, 2, 2, 2, 4,
|
|
|
|
4, 0, 18, 2, 4, 4, 4, 0,
|
|
|
|
4
|
|
|
|
};
|
|
|
|
|
2006-09-30 02:15:02 +00:00
|
|
|
static const byte opcodeParamLenElvira1[] = {
|
|
|
|
0, 6, 2, 10, 6, 4, 2, 2,
|
|
|
|
4, 4, 8, 2, 0, 2, 2, 2,
|
|
|
|
2, 2, 2, 2, 0, 4, 2, 2,
|
|
|
|
2, 8, 0, 10, 0, 8, 0, 2,
|
|
|
|
2, 0, 0, 0, 0, 2, 4, 2,
|
|
|
|
4, 4, 0, 0, 2, 2, 2, 4,
|
|
|
|
4, 0, 18, 2, 4, 4, 4, 0,
|
|
|
|
4
|
|
|
|
};
|
|
|
|
|
2006-09-19 11:59:13 +00:00
|
|
|
static const byte opcodeParamLenWW[] = {
|
2006-10-17 01:45:48 +00:00
|
|
|
0, 6, 2, 10, 6, 4, 2, 2,
|
|
|
|
4, 4, 8, 2, 2, 2, 2, 2,
|
|
|
|
2, 2, 2, 0, 4, 2, 2, 2,
|
|
|
|
8, 0, 10, 0, 8, 0, 2, 2,
|
|
|
|
0, 0, 0, 4, 4, 4, 2, 4,
|
|
|
|
4, 4, 4, 2, 2, 4, 2, 2,
|
|
|
|
2, 2, 2, 2, 2, 4, 6, 6,
|
|
|
|
0, 0, 0, 0, 2, 2, 0, 0,
|
2006-09-19 11:59:13 +00:00
|
|
|
};
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
static const byte opcodeParamLenSimon1[] = {
|
2006-10-17 01:45:48 +00:00
|
|
|
0, 6, 2, 10, 6, 4, 2, 2,
|
|
|
|
4, 4, 10, 0, 2, 2, 2, 2,
|
|
|
|
2, 0, 2, 0, 4, 2, 4, 2,
|
|
|
|
8, 0, 10, 0, 8, 0, 2, 2,
|
|
|
|
4, 0, 0, 4, 4, 2, 2, 4,
|
|
|
|
4, 4, 4, 2, 2, 2, 2, 4,
|
|
|
|
0, 2, 2, 2, 2, 4, 6, 6,
|
|
|
|
0, 0, 0, 0, 2, 6, 0, 0,
|
2002-06-29 16:11:13 +00:00
|
|
|
};
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
static const byte opcodeParamLenSimon2[] = {
|
2006-10-17 01:45:48 +00:00
|
|
|
0, 6, 2, 12, 6, 4, 2, 2,
|
|
|
|
4, 4, 9, 0, 1, 2, 2, 2,
|
|
|
|
2, 0, 2, 0, 4, 2, 4, 2,
|
|
|
|
7, 0, 10, 0, 8, 0, 2, 2,
|
|
|
|
4, 0, 0, 4, 4, 2, 2, 4,
|
|
|
|
4, 4, 4, 2, 2, 2, 2, 4,
|
|
|
|
0, 2, 2, 2, 2, 4, 6, 6,
|
|
|
|
2, 0, 6, 6, 4, 6, 0, 0,
|
|
|
|
0, 0, 4, 4, 4, 4, 4, 0,
|
|
|
|
4, 2, 2
|
2002-06-29 16:11:13 +00:00
|
|
|
};
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
static const byte opcodeParamLenFeebleFiles[] = {
|
2005-10-09 09:03:37 +00:00
|
|
|
0, 6, 2, 12, 6, 4, 2, 2,
|
|
|
|
4, 4, 9, 0, 1, 2, 2, 2,
|
|
|
|
2, 0, 2, 0, 4, 2, 4, 2,
|
|
|
|
7, 0, 10, 0, 8, 0, 2, 2,
|
|
|
|
4, 0, 0, 4, 4, 2, 2, 4,
|
|
|
|
4, 4, 4, 2, 2, 2, 2, 4,
|
|
|
|
0, 2, 2, 2, 6, 6, 6, 6,
|
|
|
|
2, 0, 6, 6, 4, 6, 0, 0,
|
|
|
|
0, 0, 4, 4, 4, 4, 4, 0,
|
|
|
|
4, 2, 2, 4, 6, 6, 0, 0,
|
|
|
|
6, 4, 2, 6, 0
|
|
|
|
};
|
|
|
|
|
2006-04-24 06:46:31 +00:00
|
|
|
uint16 opcode;
|
2006-09-28 23:22:07 +00:00
|
|
|
if (getGameType() == GType_FF || getGameType() == GType_PP) {
|
2006-04-24 06:46:31 +00:00
|
|
|
opcode = vcReadNextByte();
|
2005-12-13 00:20:11 +00:00
|
|
|
_vcPtr += opcodeParamLenFeebleFiles[opcode];
|
2005-11-12 06:01:24 +00:00
|
|
|
} else if (getGameType() == GType_SIMON2) {
|
2006-04-24 06:46:31 +00:00
|
|
|
opcode = vcReadNextByte();
|
2005-12-13 00:20:11 +00:00
|
|
|
_vcPtr += opcodeParamLenSimon2[opcode];
|
2006-09-19 11:59:13 +00:00
|
|
|
} else if (getGameType() == GType_SIMON1) {
|
2006-04-24 06:46:31 +00:00
|
|
|
opcode = vcReadNextWord();
|
2005-12-13 00:20:11 +00:00
|
|
|
_vcPtr += opcodeParamLenSimon1[opcode];
|
2006-10-04 08:53:48 +00:00
|
|
|
} else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
|
2006-09-19 11:59:13 +00:00
|
|
|
opcode = vcReadNextWord();
|
|
|
|
_vcPtr += opcodeParamLenWW[opcode];
|
2009-03-08 08:45:21 +00:00
|
|
|
} else if (getGameType() == GType_ELVIRA1) {
|
2006-09-30 02:15:02 +00:00
|
|
|
opcode = vcReadNextWord();
|
|
|
|
_vcPtr += opcodeParamLenElvira1[opcode];
|
2009-03-08 08:45:21 +00:00
|
|
|
} else {
|
|
|
|
opcode = vcReadNextWord();
|
|
|
|
_vcPtr += opcodeParamLenPN[opcode];
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2009-02-07 03:36:36 +00:00
|
|
|
if (_dumpVgaOpcodes)
|
2006-05-04 12:20:49 +00:00
|
|
|
printf("; skipped\n");
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// VGA Script commands
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc1_fadeOut() {
|
2002-06-29 16:11:13 +00:00
|
|
|
/* dummy opcode */
|
2005-05-06 11:37:33 +00:00
|
|
|
_vcPtr += 6;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc2_call() {
|
2006-10-21 00:51:32 +00:00
|
|
|
uint16 num;
|
2002-06-29 16:11:13 +00:00
|
|
|
byte *old_file_1, *old_file_2;
|
|
|
|
|
2006-10-04 08:53:48 +00:00
|
|
|
if (getGameType() == GType_ELVIRA2) {
|
|
|
|
num = vcReadNextWord();
|
|
|
|
} else {
|
|
|
|
num = vcReadVarOrWord();
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
old_file_1 = _curVgaFile1;
|
|
|
|
old_file_2 = _curVgaFile2;
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-22 05:11:27 +00:00
|
|
|
setImage(num, true);
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
_curVgaFile1 = old_file_1;
|
|
|
|
_curVgaFile2 = old_file_2;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc3_loadSprite() {
|
2007-05-15 13:01:36 +00:00
|
|
|
uint16 windowNum, zoneNum, palette, vgaSpriteId;
|
|
|
|
int16 x, y;
|
2003-07-14 12:00:20 +00:00
|
|
|
byte *old_file_1;
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2007-05-09 15:36:05 +00:00
|
|
|
windowNum = vcReadNextWord();
|
|
|
|
if (getGameType() == GType_SIMON1 && windowNum == 3) {
|
|
|
|
_window3Flag = 1;
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-09-30 02:15:02 +00:00
|
|
|
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) {
|
2007-05-09 15:36:05 +00:00
|
|
|
zoneNum = vcReadNextWord();
|
|
|
|
vgaSpriteId = vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
} else {
|
2007-05-09 15:36:05 +00:00
|
|
|
vgaSpriteId = vcReadNextWord();
|
2009-03-08 08:45:21 +00:00
|
|
|
zoneNum = (getGameType() == GType_PN) ? 0 : vgaSpriteId / 100;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2007-05-09 15:36:05 +00:00
|
|
|
x = vcReadNextWord();
|
|
|
|
y = vcReadNextWord();
|
|
|
|
palette = vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-21 10:50:19 +00:00
|
|
|
old_file_1 = _curVgaFile1;
|
|
|
|
|
2006-10-22 05:11:27 +00:00
|
|
|
animate(windowNum, zoneNum, vgaSpriteId, x, y, palette, true);
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
_curVgaFile1 = old_file_1;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc4_fadeIn() {
|
2002-06-29 16:11:13 +00:00
|
|
|
/* dummy opcode */
|
2005-05-06 11:37:33 +00:00
|
|
|
_vcPtr += 6;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-27 12:55:48 +00:00
|
|
|
void AGOSEngine::vc5_ifEqual() {
|
2006-10-02 21:41:18 +00:00
|
|
|
uint16 var;
|
|
|
|
|
|
|
|
if (getGameType() == GType_PP)
|
|
|
|
var = vcReadVarOrWord();
|
|
|
|
else
|
|
|
|
var = vcReadNextWord();
|
|
|
|
|
2006-04-24 06:46:31 +00:00
|
|
|
uint16 value = vcReadNextWord();
|
2005-12-13 00:20:11 +00:00
|
|
|
if (vcReadVar(var) != value)
|
|
|
|
vcSkipNextInstruction();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-27 12:55:48 +00:00
|
|
|
void AGOSEngine::vc6_ifObjectHere() {
|
2009-03-08 08:45:21 +00:00
|
|
|
if (!ifObjectHere(vcReadNextWord())) {
|
2005-12-13 00:20:11 +00:00
|
|
|
vcSkipNextInstruction();
|
2009-03-08 08:45:21 +00:00
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-27 12:55:48 +00:00
|
|
|
void AGOSEngine::vc7_ifObjectNotHere() {
|
2009-02-07 01:11:51 +00:00
|
|
|
if (ifObjectHere(vcReadNextWord()))
|
2005-12-13 00:20:11 +00:00
|
|
|
vcSkipNextInstruction();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-27 12:55:48 +00:00
|
|
|
void AGOSEngine::vc8_ifObjectIsAt() {
|
2006-04-24 06:46:31 +00:00
|
|
|
uint16 a = vcReadNextWord();
|
|
|
|
uint16 b = vcReadNextWord();
|
2009-02-07 01:11:51 +00:00
|
|
|
if (!ifObjectAt(a, b))
|
2005-12-13 00:20:11 +00:00
|
|
|
vcSkipNextInstruction();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-27 12:55:48 +00:00
|
|
|
void AGOSEngine::vc9_ifObjectStateIs() {
|
2006-04-24 06:46:31 +00:00
|
|
|
uint16 a = vcReadNextWord();
|
|
|
|
uint16 b = vcReadNextWord();
|
2009-02-07 01:11:51 +00:00
|
|
|
if (!ifObjectState(a, b))
|
2005-12-13 00:20:11 +00:00
|
|
|
vcSkipNextInstruction();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2009-02-07 03:36:36 +00:00
|
|
|
byte *AGOSEngine::vc10_uncompressFlip(const byte *src, uint16 w, uint16 h) {
|
2005-11-08 11:34:56 +00:00
|
|
|
w *= 8;
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-11 12:03:47 +00:00
|
|
|
byte *dst, *dstPtr, *srcPtr;
|
2005-11-08 11:34:56 +00:00
|
|
|
byte color;
|
|
|
|
int8 cur = -0x80;
|
|
|
|
uint i, w_cur = w;
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2006-10-09 13:00:25 +00:00
|
|
|
dstPtr = _videoBuf1 + w;
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2005-11-08 11:34:56 +00:00
|
|
|
do {
|
2006-10-11 12:03:47 +00:00
|
|
|
dst = dstPtr;
|
2005-11-08 11:34:56 +00:00
|
|
|
uint h_cur = h;
|
|
|
|
|
|
|
|
if (cur == -0x80)
|
|
|
|
cur = *src++;
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
if (cur >= 0) {
|
|
|
|
/* rle_same */
|
|
|
|
color = *src++;
|
|
|
|
do {
|
|
|
|
*dst = color;
|
|
|
|
dst += w;
|
|
|
|
if (!--h_cur) {
|
|
|
|
if (--cur < 0)
|
|
|
|
cur = -0x80;
|
|
|
|
else
|
|
|
|
src--;
|
|
|
|
goto next_line;
|
|
|
|
}
|
|
|
|
} while (--cur >= 0);
|
|
|
|
} else {
|
|
|
|
/* rle_diff */
|
|
|
|
do {
|
|
|
|
*dst = *src++;
|
|
|
|
dst += w;
|
|
|
|
if (!--h_cur) {
|
|
|
|
if (++cur == 0)
|
|
|
|
cur = -0x80;
|
|
|
|
goto next_line;
|
|
|
|
}
|
|
|
|
} while (++cur != 0);
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
2005-11-08 11:34:56 +00:00
|
|
|
cur = *src++;
|
|
|
|
}
|
|
|
|
next_line:
|
2006-10-09 13:00:25 +00:00
|
|
|
dstPtr++;
|
2005-11-08 11:34:56 +00:00
|
|
|
} while (--w_cur);
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-11 12:03:47 +00:00
|
|
|
srcPtr = dstPtr = _videoBuf1 + w;
|
2005-11-08 11:34:56 +00:00
|
|
|
|
|
|
|
do {
|
2006-10-11 12:03:47 +00:00
|
|
|
dst = dstPtr;
|
2005-11-08 11:34:56 +00:00
|
|
|
for (i = 0; i != w; ++i) {
|
2006-10-11 12:03:47 +00:00
|
|
|
byte b = srcPtr[i];
|
2005-11-08 11:34:56 +00:00
|
|
|
b = (b >> 4) | (b << 4);
|
|
|
|
*--dst = b;
|
|
|
|
}
|
|
|
|
|
2006-10-11 12:03:47 +00:00
|
|
|
srcPtr += w;
|
2006-10-09 13:00:25 +00:00
|
|
|
dstPtr += w;
|
2005-11-08 11:34:56 +00:00
|
|
|
} while (--h);
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
return _videoBuf1;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2009-02-07 03:36:36 +00:00
|
|
|
byte *AGOSEngine::vc10_flip(const byte *src, uint16 w, uint16 h) {
|
2006-10-09 13:00:25 +00:00
|
|
|
byte *dstPtr;
|
2005-11-08 11:34:56 +00:00
|
|
|
uint i;
|
|
|
|
|
2007-02-09 00:35:57 +00:00
|
|
|
if (getFeatures() & GF_32COLOR) {
|
|
|
|
w *= 16;
|
|
|
|
dstPtr = _videoBuf1 + w;
|
2005-11-08 11:34:56 +00:00
|
|
|
|
2007-02-09 00:35:57 +00:00
|
|
|
do {
|
|
|
|
byte *dst = dstPtr;
|
|
|
|
for (i = 0; i != w; ++i) {
|
|
|
|
*--dst = src[i];
|
|
|
|
}
|
2005-11-08 11:34:56 +00:00
|
|
|
|
2007-02-09 00:35:57 +00:00
|
|
|
src += w;
|
|
|
|
dstPtr += w;
|
|
|
|
} while (--h);
|
|
|
|
} else {
|
|
|
|
w *= 8;
|
|
|
|
dstPtr = _videoBuf1 + w;
|
|
|
|
|
|
|
|
do {
|
|
|
|
byte *dst = dstPtr;
|
|
|
|
for (i = 0; i != w; ++i) {
|
|
|
|
byte b = src[i];
|
|
|
|
b = (b >> 4) | (b << 4);
|
|
|
|
*--dst = b;
|
|
|
|
}
|
|
|
|
|
|
|
|
src += w;
|
|
|
|
dstPtr += w;
|
|
|
|
} while (--h);
|
|
|
|
}
|
2003-07-30 09:36:48 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
return _videoBuf1;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc10_draw() {
|
2007-05-06 09:35:08 +00:00
|
|
|
uint16 palette, x, y, flags;
|
|
|
|
int16 image;
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
image = (int16)vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
palette = 0;
|
2006-09-28 23:22:07 +00:00
|
|
|
if (getGameType() == GType_FF || getGameType() == GType_PP) {
|
2007-04-15 00:55:16 +00:00
|
|
|
palette = _vcPtr[0];
|
2006-09-19 11:59:13 +00:00
|
|
|
_vcPtr += 2;
|
|
|
|
} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
|
2007-04-15 00:55:16 +00:00
|
|
|
palette = _vcPtr[1];
|
2006-09-19 11:59:13 +00:00
|
|
|
_vcPtr += 2;
|
2005-11-11 09:05:19 +00:00
|
|
|
}
|
2006-09-19 11:59:13 +00:00
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
x = (int16)vcReadNextWord();
|
|
|
|
y = (int16)vcReadNextWord();
|
2006-02-14 21:20:10 +00:00
|
|
|
|
2006-09-30 02:15:02 +00:00
|
|
|
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) {
|
2007-04-15 00:55:16 +00:00
|
|
|
flags = vcReadNextByte();
|
2006-09-30 02:15:02 +00:00
|
|
|
} else {
|
2007-04-15 00:55:16 +00:00
|
|
|
flags = vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
drawImage_init(image, palette, x, y, flags);
|
2007-04-15 00:12:09 +00:00
|
|
|
}
|
|
|
|
|
2007-05-15 13:01:36 +00:00
|
|
|
void AGOSEngine::drawImage_init(int16 image, uint16 palette, int16 x, int16 y, uint16 flags) {
|
2007-04-15 00:55:16 +00:00
|
|
|
if (image == 0)
|
2007-04-15 00:12:09 +00:00
|
|
|
return;
|
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
byte *src;
|
2007-04-15 00:12:09 +00:00
|
|
|
uint width, height;
|
2007-04-15 00:55:16 +00:00
|
|
|
VC10_state state;
|
|
|
|
|
|
|
|
state.image = image;
|
|
|
|
if (state.image < 0)
|
|
|
|
state.image = vcReadVar(-state.image);
|
|
|
|
|
2009-03-08 08:45:21 +00:00
|
|
|
state.palette = (getGameType() == GType_PN) ? 0 : palette * 16;
|
2007-05-09 15:36:05 +00:00
|
|
|
state.paletteMod = 0;
|
2007-04-15 00:12:09 +00:00
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
state.x = x - _scrollX;
|
|
|
|
state.y = y - _scrollY;
|
2007-04-15 00:12:09 +00:00
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
state.flags = flags;
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
src = _curVgaFile2 + state.image * 8;
|
|
|
|
state.srcPtr = _curVgaFile2 + readUint32Wrapper(src);
|
2006-09-28 23:22:07 +00:00
|
|
|
if (getGameType() == GType_FF || getGameType() == GType_PP) {
|
2007-04-15 00:55:16 +00:00
|
|
|
width = READ_LE_UINT16(src + 6);
|
|
|
|
height = READ_LE_UINT16(src + 4) & 0x7FFF;
|
|
|
|
flags = src[5];
|
2005-10-07 06:59:49 +00:00
|
|
|
} else {
|
2007-04-15 00:55:16 +00:00
|
|
|
width = READ_BE_UINT16(src + 6) / 16;
|
|
|
|
height = src[5];
|
|
|
|
flags = src[4];
|
2005-10-07 06:59:49 +00:00
|
|
|
}
|
|
|
|
|
2002-07-07 19:06:48 +00:00
|
|
|
if (height == 0 || width == 0)
|
2002-06-29 16:11:13 +00:00
|
|
|
return;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
if (_dumpImages)
|
2007-04-15 00:55:16 +00:00
|
|
|
dumpSingleBitmap(_vgaCurZoneNum, state.image, state.srcPtr, width, height,
|
|
|
|
state.palette);
|
|
|
|
state.width = state.draw_width = width; /* cl */
|
|
|
|
state.height = state.draw_height = height; /* ch */
|
2007-02-09 00:35:57 +00:00
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
state.depack_cont = -0x80;
|
2007-02-12 03:59:29 +00:00
|
|
|
|
2007-04-15 00:55:16 +00:00
|
|
|
state.x_skip = 0; /* colums to skip = bh */
|
|
|
|
state.y_skip = 0; /* rows to skip = bl */
|
2007-02-12 03:59:29 +00:00
|
|
|
|
|
|
|
if (getFeatures() & GF_PLANAR) {
|
2009-03-08 08:45:21 +00:00
|
|
|
if (getGameType() == GType_PN) {
|
|
|
|
state.srcPtr = convertImage(&state, ((state.flags & (kDFCompressed | kDFCompressedFlip)) != 0));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
state.srcPtr = convertImage(&state, ((flags & 0x80) != 0));
|
2007-02-09 00:35:57 +00:00
|
|
|
|
|
|
|
// converted planar clip is already uncompressed
|
2007-04-15 00:55:16 +00:00
|
|
|
if (state.flags & kDFCompressedFlip) {
|
|
|
|
state.flags &= ~kDFCompressedFlip;
|
|
|
|
state.flags |= kDFFlip;
|
2007-02-09 00:35:57 +00:00
|
|
|
}
|
2007-04-15 00:55:16 +00:00
|
|
|
if (state.flags & kDFCompressed) {
|
|
|
|
state.flags &= ~kDFCompressed;
|
2007-02-09 00:35:57 +00:00
|
|
|
}
|
|
|
|
} else if (getGameType() == GType_FF || getGameType() == GType_PP) {
|
2006-02-16 22:49:26 +00:00
|
|
|
if (flags & 0x80) {
|
2007-04-15 00:55:16 +00:00
|
|
|
state.flags |= kDFCompressed;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
2006-02-16 22:49:26 +00:00
|
|
|
} else {
|
2007-04-15 00:55:16 +00:00
|
|
|
if (flags & 0x80 && !(state.flags & kDFCompressedFlip)) {
|
|
|
|
if (state.flags & kDFFlip) {
|
|
|
|
state.flags &= ~kDFFlip;
|
|
|
|
state.flags |= kDFCompressedFlip;
|
2006-02-16 22:49:26 +00:00
|
|
|
} else {
|
2007-04-15 00:55:16 +00:00
|
|
|
state.flags |= kDFCompressed;
|
2006-02-16 22:49:26 +00:00
|
|
|
}
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-28 23:22:07 +00:00
|
|
|
uint maxWidth = (getGameType() == GType_FF || getGameType() == GType_PP) ? 640 : 20;
|
2006-04-07 14:27:28 +00:00
|
|
|
if ((getGameType() == GType_SIMON2 || getGameType() == GType_FF) && width > maxWidth) {
|
2007-04-15 00:55:16 +00:00
|
|
|
horizontalScroll(&state);
|
2006-04-07 14:27:28 +00:00
|
|
|
return;
|
2006-01-11 04:06:51 +00:00
|
|
|
}
|
2006-04-07 14:27:28 +00:00
|
|
|
if (getGameType() == GType_FF && height > 480) {
|
2007-04-15 00:55:16 +00:00
|
|
|
verticalScroll(&state);
|
2002-07-07 19:06:48 +00:00
|
|
|
return;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-30 02:15:02 +00:00
|
|
|
if (getGameType() != GType_FF && getGameType() != GType_PP) {
|
2007-04-15 00:55:16 +00:00
|
|
|
if (state.flags & kDFCompressedFlip) {
|
|
|
|
state.srcPtr = vc10_uncompressFlip(state.srcPtr, width, height);
|
|
|
|
} else if (state.flags & kDFFlip) {
|
|
|
|
state.srcPtr = vc10_flip(state.srcPtr, width, height);
|
2005-11-11 09:05:19 +00:00
|
|
|
}
|
2003-05-25 03:03:40 +00:00
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2007-05-06 09:46:43 +00:00
|
|
|
drawImage(&state);
|
2006-02-16 22:35:43 +00:00
|
|
|
}
|
|
|
|
|
2009-03-08 08:45:21 +00:00
|
|
|
void AGOSEngine::checkOnStopTable() {
|
|
|
|
VgaSleepStruct *vfs = _onStopTable, *vfs_tmp;
|
|
|
|
while (vfs->ident != 0) {
|
|
|
|
if (vfs->ident == _vgaCurSpriteId) {
|
|
|
|
VgaSprite *vsp = findCurSprite();
|
|
|
|
animate(vsp->windowNum, vsp->zoneNum, vfs->id, vsp->x, vsp->y, vsp->palette, true);
|
|
|
|
vfs_tmp = vfs;
|
|
|
|
do {
|
|
|
|
memcpy(vfs_tmp, vfs_tmp + 1, sizeof(VgaSleepStruct));
|
|
|
|
vfs_tmp++;
|
|
|
|
} while (vfs_tmp->ident != 0);
|
|
|
|
} else {
|
|
|
|
vfs++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void AGOSEngine::vc11_onStop() {
|
|
|
|
uint16 id = vcReadNextWord();
|
|
|
|
|
|
|
|
VgaSleepStruct *vfs = _onStopTable;
|
|
|
|
while (vfs->ident)
|
|
|
|
vfs++;
|
|
|
|
|
|
|
|
vfs->ident = _vgaCurSpriteId;
|
|
|
|
vfs->codePtr = _vcPtr;
|
|
|
|
vfs->id = id;
|
|
|
|
vfs->zoneNum = _vgaCurZoneNum;
|
|
|
|
}
|
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
void AGOSEngine::vc12_delay() {
|
|
|
|
uint16 num;
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
if (getGameType() == GType_FF || getGameType() == GType_PP) {
|
|
|
|
num = vcReadNextByte();
|
|
|
|
} else if (getGameType() == GType_SIMON2) {
|
2007-05-13 10:07:55 +00:00
|
|
|
num = vcReadNextByte() * _frameCount;
|
2006-10-20 02:10:51 +00:00
|
|
|
} else {
|
2007-05-13 10:07:55 +00:00
|
|
|
num = vcReadVarOrWord() * _frameCount;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2007-05-13 08:46:48 +00:00
|
|
|
num += _vgaBaseDelay;
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2007-05-26 13:23:06 +00:00
|
|
|
addVgaEvent(num, ANIMATE_EVENT, _vcPtr, _vgaCurSpriteId, _vgaCurZoneNum);
|
2009-02-07 03:36:36 +00:00
|
|
|
_vcPtr = (byte *)&_vcGetOutOfCode;
|
2006-10-20 02:10:51 +00:00
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
void AGOSEngine::vc13_addToSpriteX() {
|
|
|
|
VgaSprite *vsp = findCurSprite();
|
|
|
|
vsp->x += (int16)vcReadNextWord();
|
2007-05-09 15:36:05 +00:00
|
|
|
|
|
|
|
vsp->windowNum |= 0x8000;
|
|
|
|
dirtyBackGround();
|
2006-10-20 02:10:51 +00:00
|
|
|
_vgaSpriteChanged++;
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
void AGOSEngine::vc14_addToSpriteY() {
|
|
|
|
VgaSprite *vsp = findCurSprite();
|
|
|
|
vsp->y += (int16)vcReadNextWord();
|
2007-05-09 15:36:05 +00:00
|
|
|
|
|
|
|
vsp->windowNum |= 0x8000;
|
|
|
|
dirtyBackGround();
|
2006-10-20 02:10:51 +00:00
|
|
|
_vgaSpriteChanged++;
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
void AGOSEngine::vc15_sync() {
|
|
|
|
VgaSleepStruct *vfs = _waitSyncTable, *vfs_tmp;
|
2009-03-08 08:45:21 +00:00
|
|
|
uint16 id;
|
|
|
|
|
|
|
|
if (getGameType() == GType_PN)
|
|
|
|
id = _vgaCurSpriteId;
|
|
|
|
else
|
|
|
|
id = vcReadNextWord();
|
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
while (vfs->ident != 0) {
|
|
|
|
if (vfs->ident == id) {
|
2009-02-07 01:11:51 +00:00
|
|
|
addVgaEvent(_vgaBaseDelay, ANIMATE_EVENT, vfs->codePtr, vfs->id, vfs->zoneNum);
|
2006-10-20 02:10:51 +00:00
|
|
|
vfs_tmp = vfs;
|
|
|
|
do {
|
|
|
|
memcpy(vfs_tmp, vfs_tmp + 1, sizeof(VgaSleepStruct));
|
|
|
|
vfs_tmp++;
|
|
|
|
} while (vfs_tmp->ident != 0);
|
|
|
|
} else {
|
|
|
|
vfs++;
|
|
|
|
}
|
2005-11-19 11:37:41 +00:00
|
|
|
}
|
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
_lastVgaWaitFor = id;
|
|
|
|
/* clear a wait event */
|
|
|
|
if (id == _vgaWaitFor)
|
|
|
|
_vgaWaitFor = 0;
|
2005-11-19 11:37:41 +00:00
|
|
|
}
|
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
void AGOSEngine::vc16_waitSync() {
|
|
|
|
VgaSleepStruct *vfs = _waitSyncTable;
|
|
|
|
while (vfs->ident)
|
|
|
|
vfs++;
|
2006-03-16 03:15:05 +00:00
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
vfs->ident = vcReadNextWord();
|
2009-02-07 01:11:51 +00:00
|
|
|
vfs->codePtr = _vcPtr;
|
|
|
|
vfs->id = _vgaCurSpriteId;
|
|
|
|
vfs->zoneNum = _vgaCurZoneNum;
|
2006-03-16 03:15:05 +00:00
|
|
|
|
2009-02-07 03:36:36 +00:00
|
|
|
_vcPtr = (byte *)&_vcGetOutOfCode;
|
2006-10-20 02:10:51 +00:00
|
|
|
}
|
2006-03-16 03:15:05 +00:00
|
|
|
|
2006-10-20 02:10:51 +00:00
|
|
|
void AGOSEngine::checkWaitEndTable() {
|
|
|
|
VgaSleepStruct *vfs = _waitEndTable, *vfs_tmp;
|
|
|
|
while (vfs->ident != 0) {
|
|
|
|
if (vfs->ident == _vgaCurSpriteId) {
|
2009-02-07 01:11:51 +00:00
|
|
|
addVgaEvent(_vgaBaseDelay, ANIMATE_EVENT, vfs->codePtr, vfs->id, vfs->zoneNum);
|
2006-10-20 02:10:51 +00:00
|
|
|
vfs_tmp = vfs;
|
2006-03-16 03:15:05 +00:00
|
|
|
do {
|
2006-10-20 02:10:51 +00:00
|
|
|
memcpy(vfs_tmp, vfs_tmp + 1, sizeof(VgaSleepStruct));
|
|
|
|
vfs_tmp++;
|
|
|
|
} while (vfs_tmp->ident != 0);
|
|
|
|
} else {
|
|
|
|
vfs++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-10-14 14:29:14 +00:00
|
|
|
|
2006-10-13 12:55:53 +00:00
|
|
|
void AGOSEngine::vc17_waitEnd() {
|
2007-06-18 09:07:03 +00:00
|
|
|
uint16 id = vcReadNextWord();
|
2009-03-08 08:45:21 +00:00
|
|
|
uint16 zoneNum = (getGameType() == GType_PN) ? 0 : id / 100;
|
2007-06-18 09:07:03 +00:00
|
|
|
|
2006-10-14 14:29:14 +00:00
|
|
|
VgaSleepStruct *vfs = _waitEndTable;
|
|
|
|
while (vfs->ident)
|
|
|
|
vfs++;
|
|
|
|
|
2009-03-08 08:45:21 +00:00
|
|
|
if (isSpriteLoaded(id, zoneNum)) {
|
2007-06-18 09:07:03 +00:00
|
|
|
vfs->ident = id;
|
2009-02-07 01:11:51 +00:00
|
|
|
vfs->codePtr = _vcPtr;
|
|
|
|
vfs->id = _vgaCurSpriteId;
|
|
|
|
vfs->zoneNum = _vgaCurZoneNum;
|
2009-02-07 03:36:36 +00:00
|
|
|
_vcPtr = (byte *)&_vcGetOutOfCode;
|
2007-06-18 09:07:03 +00:00
|
|
|
}
|
2006-10-13 12:55:53 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc18_jump() {
|
2005-12-13 00:20:11 +00:00
|
|
|
int16 offs = vcReadNextWord();
|
2005-05-06 11:37:33 +00:00
|
|
|
_vcPtr += offs;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-13 12:55:53 +00:00
|
|
|
void AGOSEngine::vc19_loop() {
|
2006-10-14 14:29:14 +00:00
|
|
|
uint16 count;
|
|
|
|
byte *b, *bb;
|
|
|
|
|
|
|
|
bb = _curVgaFile1;
|
|
|
|
b = _curVgaFile1 + READ_BE_UINT16(bb + 10);
|
|
|
|
b += 20;
|
|
|
|
|
2009-02-07 03:36:36 +00:00
|
|
|
count = READ_BE_UINT16(&((VgaFile1Header_Common *) b)->animationCount);
|
|
|
|
b = bb + READ_BE_UINT16(&((VgaFile1Header_Common *) b)->animationTable);
|
2006-10-14 14:29:14 +00:00
|
|
|
|
|
|
|
while (count--) {
|
|
|
|
if (READ_BE_UINT16(&((AnimationHeader_WW *) b)->id) == _vgaCurSpriteId)
|
|
|
|
break;
|
|
|
|
b += sizeof(AnimationHeader_WW);
|
|
|
|
}
|
|
|
|
assert(READ_BE_UINT16(&((AnimationHeader_WW *) b)->id) == _vgaCurSpriteId);
|
|
|
|
|
|
|
|
_vcPtr = _curVgaFile1 + READ_BE_UINT16(&((AnimationHeader_WW *) b)->scriptOffs);
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc20_setRepeat() {
|
2007-06-09 06:17:04 +00:00
|
|
|
// Sets counter used by the endRepeat opcode below.
|
2005-12-13 00:20:11 +00:00
|
|
|
uint16 a = vcReadNextWord();
|
2005-05-06 11:37:33 +00:00
|
|
|
WRITE_LE_UINT16(const_cast<byte *>(_vcPtr), a);
|
|
|
|
_vcPtr += 2;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc21_endRepeat() {
|
2005-12-13 00:20:11 +00:00
|
|
|
int16 a = vcReadNextWord();
|
2005-05-06 11:37:33 +00:00
|
|
|
const byte *tmp = _vcPtr + a;
|
2006-09-30 02:15:02 +00:00
|
|
|
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP)
|
2005-11-12 08:04:10 +00:00
|
|
|
tmp += 3;
|
2006-09-30 02:15:02 +00:00
|
|
|
else
|
|
|
|
tmp += 4;
|
2003-07-28 11:48:07 +00:00
|
|
|
|
2004-12-18 01:33:21 +00:00
|
|
|
uint16 val = READ_LE_UINT16(tmp);
|
2003-07-28 11:48:07 +00:00
|
|
|
if (val != 0) {
|
2004-12-18 01:33:21 +00:00
|
|
|
// Decrement counter
|
|
|
|
WRITE_LE_UINT16(const_cast<byte *>(tmp), val - 1);
|
2005-05-06 11:37:33 +00:00
|
|
|
_vcPtr = tmp + 2;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-01 07:14:13 +00:00
|
|
|
static const uint8 iconPalette[64] = {
|
|
|
|
0x00, 0x00, 0x00,
|
|
|
|
0x77, 0x77, 0x55,
|
|
|
|
0x55, 0x00, 0x00,
|
|
|
|
0x77, 0x00, 0x00,
|
|
|
|
0x22, 0x00, 0x00,
|
|
|
|
0x00, 0x11, 0x00,
|
|
|
|
0x11, 0x22, 0x11,
|
|
|
|
0x22, 0x33, 0x22,
|
|
|
|
0x44, 0x55, 0x44,
|
|
|
|
0x33, 0x44, 0x00,
|
|
|
|
0x11, 0x33, 0x00,
|
|
|
|
0x00, 0x11, 0x44,
|
|
|
|
0x77, 0x44, 0x00,
|
|
|
|
0x66, 0x22, 0x00,
|
|
|
|
0x00, 0x22, 0x66,
|
|
|
|
0x77, 0x55, 0x00,
|
|
|
|
};
|
|
|
|
|
2006-10-13 13:16:15 +00:00
|
|
|
void AGOSEngine::vc22_setPaletteOld() {
|
2006-10-13 12:55:53 +00:00
|
|
|
byte *offs, *palptr, *src;
|
|
|
|
uint16 b, num;
|
|
|
|
|
|
|
|
b = vcReadNextWord();
|
|
|
|
|
2009-03-30 08:31:30 +00:00
|
|
|
// PC EGA version of Personal Nightmare uses standard EGA palette
|
|
|
|
if (getGameType() == GType_PN && (getFeatures() & GF_EGA))
|
2009-03-08 08:45:21 +00:00
|
|
|
return;
|
|
|
|
|
2006-10-13 12:55:53 +00:00
|
|
|
num = 16;
|
|
|
|
|
|
|
|
palptr = _displayPalette;
|
|
|
|
_bottomPalette = 1;
|
|
|
|
|
2009-03-08 08:45:21 +00:00
|
|
|
if (getGameType() == GType_PN) {
|
|
|
|
if (b > 128) {
|
|
|
|
b-= 128;
|
|
|
|
palptr = _displayPalette + 64;
|
|
|
|
}
|
|
|
|
} else if (getGameType() == GType_ELVIRA1) {
|
2006-10-13 12:55:53 +00:00
|
|
|
if (b >= 1000) {
|
|
|
|
b -= 1000;
|
|
|
|
_bottomPalette = 0;
|
|
|
|
} else {
|
|
|
|
const byte extraColors[19 * 3] = {
|
|
|
|
40, 0, 0, 24, 24, 16, 48, 48, 40,
|
|
|
|
0, 0, 0, 16, 0, 0, 8, 8, 0,
|
|
|
|
48, 24, 0, 56, 40, 0, 0, 0, 24,
|
|
|
|
8, 16, 24, 24, 32, 40, 16, 24, 0,
|
|
|
|
24, 8, 0, 16, 16, 0, 40, 40, 32,
|
|
|
|
32, 32, 24, 40, 0, 0, 24, 24, 16,
|
|
|
|
48, 48, 40
|
|
|
|
};
|
|
|
|
|
|
|
|
num = 13;
|
|
|
|
|
|
|
|
for (int i = 0; i < 19; i++) {
|
|
|
|
palptr[(13 + i) * 4 + 0] = extraColors[i * 3 + 0] * 4;
|
|
|
|
palptr[(13 + i) * 4 + 1] = extraColors[i * 3 + 1] * 4;
|
|
|
|
palptr[(13 + i) * 4 + 2] = extraColors[i * 3 + 2] * 4;
|
|
|
|
palptr[(13 + i) * 4 + 3] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-01 07:14:13 +00:00
|
|
|
if (getGameType() == GType_ELVIRA2 && getPlatform() == Common::kPlatformAtariST) {
|
|
|
|
// Custom palette used for icon area
|
|
|
|
palptr = &_displayPalette[13 * 64];
|
|
|
|
for (uint8 c = 0; c < 16; c++) {
|
|
|
|
palptr[0] = iconPalette[c * 3 + 0] * 2;
|
|
|
|
palptr[1] = iconPalette[c * 3 + 1] * 2;
|
|
|
|
palptr[2] = iconPalette[c * 3 + 2] * 2;
|
|
|
|
palptr[3] = 0;
|
|
|
|
|
|
|
|
palptr += 4;
|
|
|
|
};
|
2009-03-20 10:12:20 +00:00
|
|
|
palptr = _displayPalette;
|
2009-03-01 07:14:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-13 12:55:53 +00:00
|
|
|
offs = _curVgaFile1 + READ_BE_UINT16(_curVgaFile1 + 6);
|
|
|
|
src = offs + b * 32;
|
|
|
|
|
|
|
|
do {
|
|
|
|
uint16 color = READ_BE_UINT16(src);
|
|
|
|
palptr[0] = ((color & 0xf00) >> 8) * 32;
|
|
|
|
palptr[1] = ((color & 0x0f0) >> 4) * 32;
|
|
|
|
palptr[2] = ((color & 0x00f) >> 0) * 32;
|
|
|
|
palptr[3] = 0;
|
|
|
|
|
|
|
|
palptr += 4;
|
|
|
|
src += 2;
|
|
|
|
} while (--num);
|
|
|
|
|
|
|
|
_paletteFlag = 2;
|
|
|
|
_vgaSpriteChanged++;
|
|
|
|
}
|
|
|
|
|
2006-10-13 13:16:15 +00:00
|
|
|
void AGOSEngine::vc23_setPriority() {
|
2005-12-13 00:20:11 +00:00
|
|
|
VgaSprite *vsp = findCurSprite(), *vus2;
|
|
|
|
uint16 pri = vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
VgaSprite bak;
|
|
|
|
|
2003-07-30 11:16:09 +00:00
|
|
|
if (vsp->id == 0)
|
2003-07-16 12:21:09 +00:00
|
|
|
return;
|
|
|
|
|
2002-06-29 16:11:13 +00:00
|
|
|
memcpy(&bak, vsp, sizeof(bak));
|
2002-11-28 00:22:24 +00:00
|
|
|
bak.priority = pri;
|
2005-10-05 11:37:26 +00:00
|
|
|
bak.windowNum |= 0x8000;
|
2002-06-29 16:11:13 +00:00
|
|
|
|
|
|
|
vus2 = vsp;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
if (vsp != _vgaSprites && pri < vsp[-1].priority) {
|
2002-06-29 16:11:13 +00:00
|
|
|
do {
|
|
|
|
vsp--;
|
2005-05-06 11:37:33 +00:00
|
|
|
} while (vsp != _vgaSprites && pri < vsp[-1].priority);
|
2002-06-29 16:11:13 +00:00
|
|
|
do {
|
2002-07-07 19:06:48 +00:00
|
|
|
memcpy(vus2, vus2 - 1, sizeof(VgaSprite));
|
2002-06-29 16:11:13 +00:00
|
|
|
} while (--vus2 != vsp);
|
|
|
|
memcpy(vus2, &bak, sizeof(VgaSprite));
|
2002-11-28 00:22:24 +00:00
|
|
|
} else if (vsp[1].id != 0 && pri >= vsp[1].priority) {
|
2002-06-29 16:11:13 +00:00
|
|
|
do {
|
|
|
|
vsp++;
|
2002-11-28 00:22:24 +00:00
|
|
|
} while (vsp[1].id != 0 && pri >= vsp[1].priority);
|
2002-06-29 16:11:13 +00:00
|
|
|
do {
|
2002-07-07 19:06:48 +00:00
|
|
|
memcpy(vus2, vus2 + 1, sizeof(VgaSprite));
|
2002-06-29 16:11:13 +00:00
|
|
|
} while (++vus2 != vsp);
|
|
|
|
memcpy(vus2, &bak, sizeof(VgaSprite));
|
|
|
|
} else {
|
2002-11-28 00:22:24 +00:00
|
|
|
vsp->priority = pri;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
2005-05-06 11:37:33 +00:00
|
|
|
_vgaSpriteChanged++;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc24_setSpriteXY() {
|
2005-12-13 00:20:11 +00:00
|
|
|
VgaSprite *vsp = findCurSprite();
|
2006-10-04 08:53:48 +00:00
|
|
|
|
|
|
|
if (getGameType() == GType_ELVIRA2) {
|
|
|
|
vsp->image = vcReadNextWord();
|
|
|
|
} else {
|
|
|
|
vsp->image = vcReadVarOrWord();
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
vsp->x += (int16)vcReadNextWord();
|
|
|
|
vsp->y += (int16)vcReadNextWord();
|
2006-09-30 02:15:02 +00:00
|
|
|
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) {
|
2005-12-13 00:20:11 +00:00
|
|
|
vsp->flags = vcReadNextByte();
|
2006-09-30 02:15:02 +00:00
|
|
|
} else {
|
|
|
|
vsp->flags = vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2007-05-09 15:36:05 +00:00
|
|
|
vsp->windowNum |= 0x8000;
|
|
|
|
dirtyBackGround();
|
2005-05-06 11:37:33 +00:00
|
|
|
_vgaSpriteChanged++;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc25_halt_sprite() {
|
2006-10-14 14:29:14 +00:00
|
|
|
checkWaitEndTable();
|
2009-03-08 08:45:21 +00:00
|
|
|
checkOnStopTable();
|
2006-10-14 14:29:14 +00:00
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
VgaSprite *vsp = findCurSprite();
|
2002-06-29 16:11:13 +00:00
|
|
|
while (vsp->id != 0) {
|
2002-07-07 19:06:48 +00:00
|
|
|
memcpy(vsp, vsp + 1, sizeof(VgaSprite));
|
2002-06-29 16:11:13 +00:00
|
|
|
vsp++;
|
|
|
|
}
|
2009-02-07 03:36:36 +00:00
|
|
|
_vcPtr = (byte *)&_vcGetOutOfCode;
|
2007-05-09 15:36:05 +00:00
|
|
|
|
|
|
|
dirtyBackGround();
|
2005-05-06 11:37:33 +00:00
|
|
|
_vgaSpriteChanged++;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc26_setSubWindow() {
|
2006-10-09 13:00:25 +00:00
|
|
|
uint16 *as = &_videoWindows[vcReadNextWord() * 4]; // number
|
2005-12-13 00:20:11 +00:00
|
|
|
as[0] = vcReadNextWord(); // x
|
|
|
|
as[1] = vcReadNextWord(); // y
|
|
|
|
as[2] = vcReadNextWord(); // width
|
|
|
|
as[3] = vcReadNextWord(); // height
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc27_resetSprite() {
|
2002-07-07 19:06:48 +00:00
|
|
|
VgaSprite bak, *vsp;
|
2002-06-29 16:11:13 +00:00
|
|
|
VgaSleepStruct *vfs;
|
2002-07-07 19:06:48 +00:00
|
|
|
VgaTimerEntry *vte, *vte2;
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2009-03-08 10:08:09 +00:00
|
|
|
_videoLockOut |= 8;
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-06-01 12:06:53 +00:00
|
|
|
_lastVgaWaitFor = 0;
|
|
|
|
|
2002-07-07 19:06:48 +00:00
|
|
|
memset(&bak, 0, sizeof(bak));
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
vsp = _vgaSprites;
|
2002-06-29 16:11:13 +00:00
|
|
|
while (vsp->id) {
|
2007-05-13 08:46:48 +00:00
|
|
|
// For animated heart in Elvira 2
|
|
|
|
if (getGameType() == GType_ELVIRA2 && vsp->id == 100) {
|
2002-07-07 19:06:48 +00:00
|
|
|
memcpy(&bak, vsp, sizeof(VgaSprite));
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
vsp->id = 0;
|
|
|
|
vsp++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bak.id != 0)
|
2005-05-06 11:37:33 +00:00
|
|
|
memcpy(_vgaSprites, &bak, sizeof(VgaSprite));
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-10-14 14:29:14 +00:00
|
|
|
vfs = _waitEndTable;
|
|
|
|
while (vfs->ident) {
|
|
|
|
vfs->ident = 0;
|
|
|
|
vfs++;
|
|
|
|
}
|
|
|
|
|
|
|
|
vfs = _waitSyncTable;
|
2002-06-29 16:11:13 +00:00
|
|
|
while (vfs->ident) {
|
|
|
|
vfs->ident = 0;
|
|
|
|
vfs++;
|
|
|
|
}
|
|
|
|
|
2009-03-08 08:45:21 +00:00
|
|
|
vfs = _onStopTable;
|
|
|
|
while (vfs->ident) {
|
|
|
|
vfs->ident = 0;
|
|
|
|
vfs++;
|
|
|
|
}
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
vte = _vgaTimerList;
|
2002-06-29 16:11:13 +00:00
|
|
|
while (vte->delay) {
|
2007-05-13 08:46:48 +00:00
|
|
|
// Skip the animateSprites event in earlier games
|
2007-06-01 23:12:22 +00:00
|
|
|
if (vte->type == ANIMATE_INT) {
|
2007-05-13 08:46:48 +00:00
|
|
|
vte++;
|
|
|
|
// For animated heart in Elvira 2
|
2009-02-07 01:11:51 +00:00
|
|
|
} else if (getGameType() == GType_ELVIRA2 && vte->id == 100) {
|
2002-06-29 16:11:13 +00:00
|
|
|
vte++;
|
2005-05-06 08:46:45 +00:00
|
|
|
} else {
|
|
|
|
vte2 = vte;
|
2002-06-29 16:11:13 +00:00
|
|
|
while (vte2->delay) {
|
2002-07-07 19:06:48 +00:00
|
|
|
memcpy(vte2, vte2 + 1, sizeof(VgaTimerEntry));
|
2002-06-29 16:11:13 +00:00
|
|
|
vte2++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-08 10:08:09 +00:00
|
|
|
if (_videoLockOut & 0x20) {
|
2007-05-09 15:36:05 +00:00
|
|
|
AnimTable *animTable = _screenAnim1;
|
|
|
|
while (animTable->srcPtr) {
|
|
|
|
animTable->srcPtr = 0;
|
|
|
|
animTable++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-10-27 13:08:25 +00:00
|
|
|
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP)
|
|
|
|
vcWriteVar(254, 0);
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2009-04-22 12:44:58 +00:00
|
|
|
// Stop any OmniTV video that is currently been played
|
2006-09-30 12:28:52 +00:00
|
|
|
if (getGameType() == GType_FF || getGameType() == GType_PP)
|
2006-04-25 08:01:57 +00:00
|
|
|
setBitFlag(42, true);
|
2006-03-23 04:49:03 +00:00
|
|
|
|
2009-03-08 10:08:09 +00:00
|
|
|
_videoLockOut &= ~8;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-13 12:55:53 +00:00
|
|
|
void AGOSEngine::vc28_playSFX() {
|
2007-05-28 11:22:53 +00:00
|
|
|
uint16 sound = vcReadNextWord();
|
2009-03-08 08:45:21 +00:00
|
|
|
uint16 chans = vcReadNextWord();
|
|
|
|
uint16 freq = vcReadNextWord();
|
2007-05-28 11:22:53 +00:00
|
|
|
uint16 flags = vcReadNextWord();
|
2009-03-08 08:45:21 +00:00
|
|
|
debug(0, "vc28_playSFX: (sound %d, channels %d, frequency %d, flags %d)", sound, chans, freq, flags);
|
2006-10-14 01:15:28 +00:00
|
|
|
|
2009-03-08 08:45:21 +00:00
|
|
|
loadSound(sound, freq, flags);
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc29_stopAllSounds() {
|
2006-09-29 06:58:59 +00:00
|
|
|
if (getGameType() != GType_PP)
|
|
|
|
_sound->stopVoice();
|
|
|
|
|
|
|
|
_sound->stopAllSfx();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc30_setFrameRate() {
|
2007-05-13 10:07:55 +00:00
|
|
|
_frameCount = vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc31_setWindow() {
|
2005-12-13 00:20:11 +00:00
|
|
|
_windowNum = vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-13 12:55:53 +00:00
|
|
|
void AGOSEngine::vc32_saveScreen() {
|
2009-05-04 02:05:28 +00:00
|
|
|
if (getGameType() == GType_PN) {
|
|
|
|
Graphics::Surface *screen = _system->lockScreen();
|
|
|
|
byte *dst = getBackGround();
|
|
|
|
byte *src = (byte *)screen->pixels;
|
2009-07-06 06:21:59 +00:00
|
|
|
for (int i = 0; i < _screenHeight; i++) {
|
|
|
|
memcpy(dst, src, _screenWidth);
|
2009-07-15 13:19:49 +00:00
|
|
|
dst += _backGroundBuf->pitch;
|
|
|
|
src += screen->pitch;
|
2009-07-06 06:21:59 +00:00
|
|
|
}
|
2009-05-04 02:05:28 +00:00
|
|
|
_system->unlockScreen();
|
|
|
|
} else {
|
|
|
|
uint16 xoffs = _videoWindows[4 * 4 + 0] * 16;
|
|
|
|
uint16 yoffs = _videoWindows[4 * 4 + 1];
|
|
|
|
uint16 width = _videoWindows[4 * 4 + 2] * 16;
|
|
|
|
uint16 height = _videoWindows[4 * 4 + 3];
|
|
|
|
|
2009-07-06 06:21:59 +00:00
|
|
|
byte *dst = (byte *)_backGroundBuf->getBasePtr(xoffs, yoffs);
|
|
|
|
byte *src = (byte *)_window4BackScn->pixels;;
|
2009-05-04 02:05:28 +00:00
|
|
|
uint16 srcWidth = _videoWindows[4 * 4 + 2] * 16;
|
|
|
|
for (; height > 0; height--) {
|
|
|
|
memcpy(dst, src, width);
|
2009-07-06 06:21:59 +00:00
|
|
|
dst += _backGroundBuf->pitch;
|
2009-05-04 02:05:28 +00:00
|
|
|
src += srcWidth;
|
|
|
|
}
|
2007-05-09 15:36:05 +00:00
|
|
|
}
|
2006-10-13 12:55:53 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc33_setMouseOn() {
|
2005-12-08 06:12:04 +00:00
|
|
|
if (_mouseHideCount != 0) {
|
|
|
|
_mouseHideCount = 1;
|
2006-11-06 07:58:37 +00:00
|
|
|
if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
|
|
|
|
// Set mouse palette
|
|
|
|
_displayPalette[65 * 4 + 0] = 48 * 4;
|
|
|
|
_displayPalette[65 * 4 + 1] = 48 * 4;
|
|
|
|
_displayPalette[65 * 4 + 2] = 40 * 4;
|
|
|
|
_displayPalette[65 * 4 + 3] = 0;
|
2007-06-05 06:05:28 +00:00
|
|
|
_paletteFlag = 1;
|
2006-11-06 07:58:37 +00:00
|
|
|
}
|
2005-12-08 06:12:04 +00:00
|
|
|
mouseOn();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc34_setMouseOff() {
|
2006-11-11 11:54:51 +00:00
|
|
|
mouseOff();
|
|
|
|
_mouseHideCount = 200;
|
2009-03-09 03:45:33 +00:00
|
|
|
_leftButtonDown = false;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2007-06-21 06:37:00 +00:00
|
|
|
void AGOSEngine::clearVideoBackGround(uint16 num, uint16 color) {
|
2007-05-09 15:36:05 +00:00
|
|
|
const uint16 *vlut = &_videoWindows[num * 4];
|
2009-07-06 06:21:59 +00:00
|
|
|
byte *dst = (byte *)_backGroundBuf->getBasePtr(vlut[0] * 16, vlut[1]);
|
2007-05-09 15:36:05 +00:00
|
|
|
|
|
|
|
for (uint h = 0; h < vlut[3]; h++) {
|
|
|
|
memset(dst, color, vlut[2] * 16);
|
2009-07-06 06:21:59 +00:00
|
|
|
dst += _backGroundBuf->pitch;
|
2007-05-09 15:36:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-06-21 06:37:00 +00:00
|
|
|
void AGOSEngine::clearVideoWindow(uint16 num, uint16 color) {
|
2006-10-11 12:03:47 +00:00
|
|
|
if (getGameType() == GType_ELVIRA1) {
|
|
|
|
if (num == 2 || num == 6)
|
|
|
|
return;
|
|
|
|
} else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
|
|
|
|
if (num != 4 && num < 10)
|
|
|
|
return;
|
2007-05-09 15:36:05 +00:00
|
|
|
} else if (getGameType() == GType_SIMON1) {
|
|
|
|
if (num != 4)
|
|
|
|
return;
|
2006-10-11 12:03:47 +00:00
|
|
|
}
|
|
|
|
|
2009-02-07 01:11:51 +00:00
|
|
|
if (getGameType() == GType_ELVIRA1 && num == 3) {
|
|
|
|
Graphics::Surface *screen = _system->lockScreen();
|
2009-07-06 06:21:59 +00:00
|
|
|
byte *dst = (byte *)screen->pixels;
|
|
|
|
for (int i = 0; i < _screenHeight; i++) {
|
|
|
|
memset(dst, color, _screenWidth);
|
|
|
|
dst += screen->pitch;
|
|
|
|
}
|
2009-02-07 01:11:51 +00:00
|
|
|
_system->unlockScreen();
|
2009-08-09 07:16:08 +00:00
|
|
|
} else {
|
2006-10-11 12:03:47 +00:00
|
|
|
const uint16 *vlut = &_videoWindows[num * 4];
|
2009-02-07 01:11:51 +00:00
|
|
|
uint16 xoffs = (vlut[0] - _videoWindows[16]) * 16;
|
|
|
|
uint16 yoffs = (vlut[1] - _videoWindows[17]);
|
2007-06-21 06:37:00 +00:00
|
|
|
uint16 dstWidth = _videoWindows[18] * 16;
|
2009-07-06 06:21:59 +00:00
|
|
|
byte *dst = (byte *)_window4BackScn->pixels + xoffs + yoffs * dstWidth;
|
2007-05-09 15:36:05 +00:00
|
|
|
|
|
|
|
setMoveRect(0, 0, vlut[2] * 16, vlut[3]);
|
2006-10-11 12:03:47 +00:00
|
|
|
|
|
|
|
for (uint h = 0; h < vlut[3]; h++) {
|
2007-05-09 15:36:05 +00:00
|
|
|
memset(dst, color, vlut[2] * 16);
|
|
|
|
dst += dstWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
_window4Flag = 1;
|
2006-10-11 12:03:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc35_clearWindow() {
|
2006-10-08 07:42:34 +00:00
|
|
|
uint16 num = vcReadNextWord();
|
|
|
|
uint16 color = vcReadNextWord();
|
2007-05-09 15:36:05 +00:00
|
|
|
|
|
|
|
// Clear video background
|
|
|
|
if (getGameType() == GType_ELVIRA1) {
|
|
|
|
if (num == 2 || num == 6)
|
|
|
|
return;
|
|
|
|
} else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
|
|
|
|
if (num != 4 && num < 10)
|
|
|
|
return;
|
|
|
|
} else if (getGameType() == GType_SIMON1) {
|
|
|
|
if (num != 4)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-02-15 13:54:53 +00:00
|
|
|
// Clear video window
|
|
|
|
clearVideoWindow(num, color);
|
2007-05-09 15:36:05 +00:00
|
|
|
clearVideoBackGround(num, color);
|
2009-02-15 13:54:53 +00:00
|
|
|
_vgaSpriteChanged++;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc36_setWindowImage() {
|
2007-05-13 08:46:48 +00:00
|
|
|
_displayScreen = false;
|
2006-04-24 06:46:31 +00:00
|
|
|
uint16 vga_res = vcReadNextWord();
|
|
|
|
uint16 windowNum = vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-09-28 23:22:07 +00:00
|
|
|
if (getGameType() == GType_FF || getGameType() == GType_PP) {
|
2007-06-21 05:10:42 +00:00
|
|
|
fillBackGroundFromFront();
|
2006-10-02 14:32:28 +00:00
|
|
|
} else {
|
2006-10-21 00:51:32 +00:00
|
|
|
setWindowImage(windowNum, vga_res);
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-10-13 12:55:53 +00:00
|
|
|
void AGOSEngine::vc37_pokePalette() {
|
2006-10-28 04:44:10 +00:00
|
|
|
uint16 offs = vcReadNextWord();
|
|
|
|
uint16 color = vcReadNextWord();
|
|
|
|
|
2009-03-30 08:31:30 +00:00
|
|
|
// PC EGA version of Personal Nightmare uses standard EGA palette
|
|
|
|
if (getGameType() == GType_PN && (getFeatures() & GF_EGA))
|
2009-03-08 08:45:21 +00:00
|
|
|
return;
|
|
|
|
|
2006-10-28 04:44:10 +00:00
|
|
|
byte *palptr = _displayPalette + offs * 4;
|
|
|
|
palptr[0] = ((color & 0xf00) >> 8) * 32;
|
|
|
|
palptr[1] = ((color & 0x0f0) >> 4) * 32;
|
|
|
|
palptr[2] = ((color & 0x00f) >> 0) * 32;
|
|
|
|
palptr[3] = 0;
|
|
|
|
|
2009-03-08 10:08:09 +00:00
|
|
|
if (!(_videoLockOut & 0x20)) {
|
2007-05-27 11:46:42 +00:00
|
|
|
_paletteFlag = 1;
|
|
|
|
_displayScreen++;
|
|
|
|
}
|
2006-10-13 12:55:53 +00:00
|
|
|
}
|
|
|
|
|
2006-10-27 12:55:48 +00:00
|
|
|
void AGOSEngine::vc38_ifVarNotZero() {
|
2006-10-02 21:41:18 +00:00
|
|
|
uint16 var;
|
|
|
|
if (getGameType() == GType_PP)
|
|
|
|
var = vcReadVarOrWord();
|
|
|
|
else
|
|
|
|
var = vcReadNextWord();
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
if (vcReadVar(var) == 0)
|
|
|
|
vcSkipNextInstruction();
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc39_setVar() {
|
2006-10-02 21:41:18 +00:00
|
|
|
uint16 var;
|
|
|
|
if (getGameType() == GType_PP)
|
|
|
|
var = vcReadVarOrWord();
|
|
|
|
else
|
|
|
|
var = vcReadNextWord();
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
int16 value = vcReadNextWord();
|
|
|
|
vcWriteVar(var, value);
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2007-06-30 17:34:49 +00:00
|
|
|
void AGOSEngine::vc40_scrollRight() {
|
2006-04-24 06:46:31 +00:00
|
|
|
uint16 var = vcReadNextWord();
|
2005-12-13 00:20:11 +00:00
|
|
|
int16 value = vcReadVar(var) + vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2007-05-13 08:46:48 +00:00
|
|
|
if (getGameType() == GType_SIMON2 && var == 15 && !getBitFlag(80)) {
|
2007-06-30 17:34:49 +00:00
|
|
|
if ((_scrollCount < 0) || (_scrollCount == 0 && _scrollFlag == 0)) {
|
2005-10-05 11:37:26 +00:00
|
|
|
_scrollCount = 0;
|
2007-06-30 17:34:49 +00:00
|
|
|
if (value - _scrollX >= 30) {
|
|
|
|
_scrollCount = MIN(20, _scrollXMax - _scrollX);
|
|
|
|
addVgaEvent(6, SCROLL_EVENT, NULL, 0, 0);
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
vcWriteVar(var, value);
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2007-06-30 17:34:49 +00:00
|
|
|
void AGOSEngine::vc41_scrollLeft() {
|
2006-04-24 06:46:31 +00:00
|
|
|
uint16 var = vcReadNextWord();
|
2005-12-13 00:20:11 +00:00
|
|
|
int16 value = vcReadVar(var) - vcReadNextWord();
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2007-05-13 08:46:48 +00:00
|
|
|
if (getGameType() == GType_SIMON2 && var == 15 && !getBitFlag(80)) {
|
2007-06-30 17:34:49 +00:00
|
|
|
if ((_scrollCount > 0) || (_scrollCount == 0 && _scrollFlag == 0)) {
|
|
|
|
_scrollCount = 0;
|
|
|
|
if ((uint16)(value - _scrollX) < 11) {
|
|
|
|
_scrollCount = -MIN(20, (int)_scrollX);
|
|
|
|
addVgaEvent(6, SCROLL_EVENT, NULL, 0, 0);
|
|
|
|
}
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
vcWriteVar(var, value);
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
void AGOSEngine::vc42_delayIfNotEQ() {
|
2006-04-24 06:46:31 +00:00
|
|
|
uint16 val = vcReadVar(vcReadNextWord());
|
2005-12-13 00:20:11 +00:00
|
|
|
if (val != vcReadNextWord()) {
|
2007-05-26 13:23:06 +00:00
|
|
|
addVgaEvent(_frameCount + 1, ANIMATE_EVENT, _vcPtr - 4, _vgaCurSpriteId, _vgaCurZoneNum);
|
2009-02-07 03:36:36 +00:00
|
|
|
_vcPtr = (byte *)&_vcGetOutOfCode;
|
2002-06-29 16:11:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
} // End of namespace AGOS
|