[Scummvm-cvs-logs] SF.net SVN: scummvm: [24107] scummvm/trunk/engines/agos
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Wed Oct 4 10:53:56 CEST 2006
Revision: 24107
http://svn.sourceforge.net/scummvm/?rev=24107&view=rev
Author: kirben
Date: 2006-10-04 01:53:48 -0700 (Wed, 04 Oct 2006)
Log Message:
-----------
Add video opcode differences in Elvira 2
Modified Paths:
--------------
scummvm/trunk/engines/agos/agos.cpp
scummvm/trunk/engines/agos/debug.cpp
scummvm/trunk/engines/agos/debug.h
scummvm/trunk/engines/agos/items.cpp
scummvm/trunk/engines/agos/subroutine.cpp
scummvm/trunk/engines/agos/vga.cpp
Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp 2006-10-04 07:10:22 UTC (rev 24106)
+++ scummvm/trunk/engines/agos/agos.cpp 2006-10-04 08:53:48 UTC (rev 24107)
@@ -614,7 +614,7 @@
} else if (getGameType() == GType_ELVIRA2) {
gss = PTR(simon1_settings);
_numTextBoxes = 20;
- _numVideoOpcodes = 56;
+ _numVideoOpcodes = 60;
#ifndef PALMOS_68K
_vgaMemSize = 1000000;
#else
@@ -626,7 +626,7 @@
} else if (getGameType() == GType_ELVIRA) {
gss = PTR(simon1_settings);
_numTextBoxes = 20;
- _numVideoOpcodes = 56;
+ _numVideoOpcodes = 57;
#ifndef PALMOS_68K
_vgaMemSize = 1000000;
#else
@@ -634,7 +634,7 @@
#endif
_tableMemSize = 150000;
_vgaBaseDelay = 1;
- _numVars = 512;
+ _numVars = 256;
}
allocItemHeap();
Modified: scummvm/trunk/engines/agos/debug.cpp
===================================================================
--- scummvm/trunk/engines/agos/debug.cpp 2006-10-04 07:10:22 UTC (rev 24106)
+++ scummvm/trunk/engines/agos/debug.cpp 2006-10-04 08:53:48 UTC (rev 24107)
@@ -37,7 +37,7 @@
uint opcode;
const char *s, *st;
- if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2) {
+ if (getGameType() == GType_ELVIRA) {
opcode = READ_BE_UINT16(p);
p += 2;
if (opcode == 10000)
Modified: scummvm/trunk/engines/agos/debug.h
===================================================================
--- scummvm/trunk/engines/agos/debug.h 2006-10-04 07:10:22 UTC (rev 24106)
+++ scummvm/trunk/engines/agos/debug.h 2006-10-04 08:53:48 UTC (rev 24107)
@@ -1784,7 +1784,7 @@
/* 44 */
"d|SKIP_IF_BIT_SET",
"dd|VC_45",
- "v|SET_SPRITE_Y",
+ "d|VC_46",
"d|VC_47",
/* 48 */
"d|VC_48",
Modified: scummvm/trunk/engines/agos/items.cpp
===================================================================
--- scummvm/trunk/engines/agos/items.cpp 2006-10-04 07:10:22 UTC (rev 24106)
+++ scummvm/trunk/engines/agos/items.cpp 2006-10-04 08:53:48 UTC (rev 24107)
@@ -308,6 +308,16 @@
void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) {
setupCommonOpcodes(op);
+
+ op[83] = &AGOSEngine::o1_rescan;
+ op[98] = &AGOSEngine::o1_animate;
+ op[99] = &AGOSEngine::o1_stopAnimate;
+ op[127] = &AGOSEngine::o1_playTune;
+ op[148] = &AGOSEngine::oww_ifDoorOpen;
+ op[180] = &AGOSEngine::o_b2Set;
+ op[181] = &AGOSEngine::o_b2Clear;
+ op[182] = &AGOSEngine::o_b2Zero;
+ op[183] = &AGOSEngine::o_b2NotZero;
}
void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) {
@@ -2645,6 +2655,8 @@
if (opcode == 0) {
flag = true;
opcode = getByte();
+ debug(1, "runScript: opcode %d", opcode);
+
if (opcode == 0xFF)
return 0;
}
Modified: scummvm/trunk/engines/agos/subroutine.cpp
===================================================================
--- scummvm/trunk/engines/agos/subroutine.cpp 2006-10-04 07:10:22 UTC (rev 24106)
+++ scummvm/trunk/engines/agos/subroutine.cpp 2006-10-04 08:53:48 UTC (rev 24107)
@@ -476,7 +476,7 @@
void AGOSEngine::runSubroutine101() {
Subroutine *sub;
- if (getGameType() == GType_ELVIRA) {
+ if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2) {
// HACK
sub = getSubroutineByID(1);
} else {
Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp 2006-10-04 07:10:22 UTC (rev 24106)
+++ scummvm/trunk/engines/agos/vga.cpp 2006-10-04 08:53:48 UTC (rev 24107)
@@ -392,7 +392,7 @@
} else if (getGameType() == GType_SIMON1) {
opcode = vcReadNextWord();
_vcPtr += opcodeParamLenSimon1[opcode];
- } else if (getGameType() == GType_WW) {
+ } else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
opcode = vcReadNextWord();
_vcPtr += opcodeParamLenWW[opcode];
} else {
@@ -417,7 +417,11 @@
byte *b, *bb;
const byte *vcPtrOrg;
- num = vcReadVarOrWord();
+ if (getGameType() == GType_ELVIRA2) {
+ num = vcReadNextWord();
+ } else {
+ num = vcReadVarOrWord();
+ }
old_file_1 = _curVgaFile1;
old_file_2 = _curVgaFile2;
@@ -1608,7 +1612,7 @@
}
void AGOSEngine::vc11_clearPathFinder() {
- if (getGameType() == GType_WW) {
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
// FIXME
vcReadNextWord();
} else {
@@ -1687,7 +1691,7 @@
}
void AGOSEngine::vc17_setPathfinderItem() {
- if (getGameType() == GType_WW) {
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
// FIXME
vcReadNextWord();
} else {
@@ -1839,8 +1843,13 @@
void AGOSEngine::vc24_setSpriteXY() {
VgaSprite *vsp = findCurSprite();
- vsp->image = vcReadVarOrWord();
+ if (getGameType() == GType_ELVIRA2) {
+ vsp->image = vcReadNextWord();
+ } else {
+ vsp->image = vcReadVarOrWord();
+ }
+
vsp->x += (int16)vcReadNextWord();
vsp->y += (int16)vcReadNextWord();
if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) {
@@ -1941,7 +1950,7 @@
}
void AGOSEngine::vc32_copyVar() {
- if (getGameType() == GType_WW) {
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
// FIXME
} else {
uint16 a = vcReadVar(vcReadNextWord());
@@ -1987,7 +1996,7 @@
}
void AGOSEngine::vc37_addToSpriteY() {
- if (getGameType() == GType_WW) {
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
// FIXME
vcReadNextWord();
vcReadNextWord();
@@ -2097,7 +2106,7 @@
}
void AGOSEngine::vc45_setSpriteX() {
- if (getGameType() == GType_WW) {
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
//FIXME
vcReadNextWord();
vcReadNextWord();
@@ -2109,13 +2118,18 @@
}
void AGOSEngine::vc46_setSpriteY() {
- VgaSprite *vsp = findCurSprite();
- vsp->y = vcReadVar(vcReadNextWord());
- _vgaSpriteChanged++;
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+ //FIXME
+ vcReadNextWord();
+ } else {
+ VgaSprite *vsp = findCurSprite();
+ vsp->y = vcReadVar(vcReadNextWord());
+ _vgaSpriteChanged++;
+ }
}
void AGOSEngine::vc47_addToVar() {
- if (getGameType() == GType_WW) {
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
//FIXME
vcReadNextWord();
} else {
@@ -2128,7 +2142,7 @@
uint16 a = (uint16)_variableArrayPtr[12];
const uint16 *p = _pathFindArray[a - 1];
- if (getGameType() == GType_WW) {
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
//FIXME
vcReadNextWord();
} else if (getGameType() == GType_FF || getGameType() == GType_PP) {
@@ -2314,7 +2328,7 @@
}
void AGOSEngine::vc56_delay() {
- if (getGameType() == GType_WW) {
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
byte *src = _curVgaFile2 + 32;
byte *dst = getBackBuf();
@@ -2341,30 +2355,33 @@
uint8 palette[1024];
memset(palette, 0, sizeof(palette));
_system->setPalette(palette, 0, 256);
+ } else {
+ debug(1, "vc57_blackPalette");
}
}
void AGOSEngine::vc58() {
- if (getGameType() == GType_WW)
- error("Code whell");;
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+ // FIXME
+ } else {
+ uint16 sprite = _vgaCurSpriteId;
+ uint16 file = _vgaCurZoneNum;
+ const byte *vcPtrOrg;
+ uint16 tmp;
- uint16 sprite = _vgaCurSpriteId;
- uint16 file = _vgaCurZoneNum;
- const byte *vcPtrOrg;
- uint16 tmp;
+ _vgaCurZoneNum = vcReadNextWord();
+ _vgaCurSpriteId = vcReadNextWord();
- _vgaCurZoneNum = vcReadNextWord();
- _vgaCurSpriteId = vcReadNextWord();
+ tmp = to16Wrapper(vcReadNextWord());
- tmp = to16Wrapper(vcReadNextWord());
+ vcPtrOrg = _vcPtr;
+ _vcPtr = (byte *)&tmp;
+ vc23_setSpritePriority();
- vcPtrOrg = _vcPtr;
- _vcPtr = (byte *)&tmp;
- vc23_setSpritePriority();
-
- _vcPtr = vcPtrOrg;
- _vgaCurSpriteId = sprite;
- _vgaCurZoneNum = file;
+ _vcPtr = vcPtrOrg;
+ _vgaCurSpriteId = sprite;
+ _vgaCurZoneNum = file;
+ }
}
void AGOSEngine::vc59() {
@@ -2379,7 +2396,7 @@
} else if (getGameType() == GType_SIMON1) {
if (!_sound->isVoiceActive())
vcSkipNextInstruction();
- } else {
+ } else if (getGameType() == GType_WW) {
// Skip if not EGA
vcSkipNextInstruction();
}
@@ -2449,7 +2466,7 @@
void AGOSEngine::vc61_setMaskImage() {
if (getGameType() == GType_WW) {
- uint16 a = vcReadVarOrWord();
+ uint16 a = vcReadNextWord();
byte *src, *dst;
if (a == 6) {
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