diff options
Diffstat (limited to 'engines/agos')
-rw-r--r-- | engines/agos/agos.cpp | 6 | ||||
-rw-r--r-- | engines/agos/debug.cpp | 2 | ||||
-rw-r--r-- | engines/agos/debug.h | 2 | ||||
-rw-r--r-- | engines/agos/items.cpp | 12 | ||||
-rw-r--r-- | engines/agos/subroutine.cpp | 2 | ||||
-rw-r--r-- | engines/agos/vga.cpp | 81 |
6 files changed, 67 insertions, 38 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 72dc0244da..1ae1b64f6d 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -614,7 +614,7 @@ void AGOSEngine::setupGame() { } 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 @@ void AGOSEngine::setupGame() { } 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 @@ void AGOSEngine::setupGame() { #endif _tableMemSize = 150000; _vgaBaseDelay = 1; - _numVars = 512; + _numVars = 256; } allocItemHeap(); diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp index 20e445b6d5..86baf0fb10 100644 --- a/engines/agos/debug.cpp +++ b/engines/agos/debug.cpp @@ -37,7 +37,7 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) { 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) diff --git a/engines/agos/debug.h b/engines/agos/debug.h index 72fa09221d..86ffc7024c 100644 --- a/engines/agos/debug.h +++ b/engines/agos/debug.h @@ -1784,7 +1784,7 @@ const char *const ww_video_opcode_name_table[] = { /* 44 */ "d|SKIP_IF_BIT_SET", "dd|VC_45", - "v|SET_SPRITE_Y", + "d|VC_46", "d|VC_47", /* 48 */ "d|VC_48", diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp index e53ef8095b..726f9c7837 100644 --- a/engines/agos/items.cpp +++ b/engines/agos/items.cpp @@ -308,6 +308,16 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) { 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 @@ int AGOSEngine::runScript() { if (opcode == 0) { flag = true; opcode = getByte(); + debug(1, "runScript: opcode %d", opcode); + if (opcode == 0xFF) return 0; } diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index 36c1a28aeb..3d295071fc 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -476,7 +476,7 @@ SubroutineLine *AGOSEngine::createSubroutineLine(Subroutine *sub, int where) { void AGOSEngine::runSubroutine101() { Subroutine *sub; - if (getGameType() == GType_ELVIRA) { + if (getGameType() == GType_ELVIRA || getGameType() == GType_ELVIRA2) { // HACK sub = getSubroutineByID(1); } else { diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index 2fc7112be4..e81c4e7424 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -392,7 +392,7 @@ void AGOSEngine::vcSkipNextInstruction() { } 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 @@ void AGOSEngine::vc2_call() { 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::scaleClip(int16 h, int16 w, int16 y, int16 x, int16 scrollY) { } void AGOSEngine::vc11_clearPathFinder() { - if (getGameType() == GType_WW) { + if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) { // FIXME vcReadNextWord(); } else { @@ -1687,7 +1691,7 @@ void AGOSEngine::vc16_waitSync() { } void AGOSEngine::vc17_setPathfinderItem() { - if (getGameType() == GType_WW) { + if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) { // FIXME vcReadNextWord(); } else { @@ -1839,7 +1843,12 @@ void AGOSEngine::vc23_setSpritePriority() { 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(); @@ -1941,7 +1950,7 @@ void AGOSEngine::vc31_setWindow() { } 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::vc36_setWindowImage() { } void AGOSEngine::vc37_addToSpriteY() { - if (getGameType() == GType_WW) { + if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) { // FIXME vcReadNextWord(); vcReadNextWord(); @@ -2097,7 +2106,7 @@ void AGOSEngine::vc44_skipIfBitSet() { } void AGOSEngine::vc45_setSpriteX() { - if (getGameType() == GType_WW) { + if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) { //FIXME vcReadNextWord(); vcReadNextWord(); @@ -2109,13 +2118,18 @@ void AGOSEngine::vc45_setSpriteX() { } 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 @@ void AGOSEngine::vc48_setPathFinder() { 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::vc55_moveBox() { } 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 @@ void AGOSEngine::vc57_blackPalette() { 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");; - - uint16 sprite = _vgaCurSpriteId; - uint16 file = _vgaCurZoneNum; - const byte *vcPtrOrg; - uint16 tmp; + if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) { + // FIXME + } else { + 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 @@ void AGOSEngine::vc59() { } 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::vc60_killSprite() { void AGOSEngine::vc61_setMaskImage() { if (getGameType() == GType_WW) { - uint16 a = vcReadVarOrWord(); + uint16 a = vcReadNextWord(); byte *src, *dst; if (a == 6) { |