From 4b46821ffbd7e617abc88a3f3f566a31cb59d340 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sat, 28 Oct 2006 03:29:58 +0000 Subject: Add more fixes for Elvira 1 svn-id: r24547 --- engines/agos/agos.h | 1 + engines/agos/debug.cpp | 8 ++++---- engines/agos/debug.h | 36 ++++++++++++++++++------------------ engines/agos/gfx.cpp | 2 +- engines/agos/script_e1.cpp | 17 ++++++++++------- engines/agos/script_e2.cpp | 1 + engines/agos/subroutine.cpp | 12 ------------ engines/agos/vga.cpp | 7 +++++-- 8 files changed, 40 insertions(+), 44 deletions(-) (limited to 'engines') diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 624387c239..7ad81954be 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -1106,6 +1106,7 @@ public: void oe1_pObj(); void oe1_pName(); void oe1_pcName(); + void oe1_isCalled(); void oe1_cFlag(); void oe1_rescan(); void oe1_setUserItem(); diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp index cc600f4ff2..b2e5d5cacf 100644 --- a/engines/agos/debug.cpp +++ b/engines/agos/debug.cpp @@ -130,13 +130,13 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) { int n = (int16)READ_BE_UINT16(p); p += 2; if (n == -1) - printf("ITEM_M1 "); + printf("SUBJECT_ITEM "); else if (n == -3) - printf("ITEM_M3 "); + printf("OBJECT_ITEM "); else if (n == -5) - printf("ITEM_1 "); + printf("ME_ITEM "); else if (n == -7) - printf("ITEM_0 "); + printf("ACTOR_ITEM "); else if (n == -9) printf("ITEM_A_PARENT "); else diff --git a/engines/agos/debug.h b/engines/agos/debug.h index 5ea66d82b7..a6a31b9ccb 100644 --- a/engines/agos/debug.h +++ b/engines/agos/debug.h @@ -188,8 +188,8 @@ static const char *const elvira1_opcodeNameTable[300] = { NULL, NULL, /* 128 */ - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", NULL, NULL, /* 132 */ @@ -482,8 +482,8 @@ static const char *const elvira2_opcodeNameTable[256] = { "I|PRINT_CNAME", /* 76 */ "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", "ITJ|CHILD_FR2_IS", /* 80 */ "IIJ|IS_ITEM_EQ", @@ -715,8 +715,8 @@ static const char *const waxworks_opcodeNameTable[256] = { NULL, /* 76 */ "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", "ITJ|CHILD_FR2_IS", /* 80 */ "IIJ|IS_ITEM_EQ", @@ -957,8 +957,8 @@ static const char *const simon1dos_opcodeNameTable[256] = { NULL, /* 76 */ "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", "ITJ|CHILD_FR2_IS", /* 80 */ "IIJ|IS_ITEM_EQ", @@ -1195,8 +1195,8 @@ static const char *const simon1talkie_opcodeNameTable[256] = { NULL, /* 76 */ "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", "ITJ|CHILD_FR2_IS", /* 80 */ "IIJ|IS_ITEM_EQ", @@ -1433,8 +1433,8 @@ static const char *const simon2dos_opcodeNameTable[256] = { NULL, /* 76 */ "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", "ITJ|CHILD_FR2_IS", /* 80 */ "IIJ|IS_ITEM_EQ", @@ -1675,8 +1675,8 @@ static const char *const simon2talkie_opcodeNameTable[256] = { NULL, /* 76 */ "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", "ITJ|CHILD_FR2_IS", /* 80 */ "IIJ|IS_ITEM_EQ", @@ -1917,8 +1917,8 @@ static const char *const feeblefiles_opcodeNameTable[256] = { NULL, /* 76 */ "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", "ITJ|CHILD_FR2_IS", /* 80 */ "IIJ|IS_ITEM_EQ", @@ -2170,8 +2170,8 @@ static const char *const puzzlepack_opcodeNameTable[256] = { NULL, /* 76 */ "WW|ADD_TIMEOUT", - "J|IS_M1_EMPTY", - "J|IS_M3_EMPTY", + "J|IS_SUBJECT_ITEM_EMPTY", + "J|IS_OBJECT_ITEM_EMPTY", "ITJ|CHILD_FR2_IS", /* 80 */ "IIJ|IS_ITEM_EQ", diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp index 91e720c2ab..009367f185 100644 --- a/engines/agos/gfx.cpp +++ b/engines/agos/gfx.cpp @@ -548,7 +548,7 @@ void AGOSEngine::drawImages(VC10_state *state) { } while (--h); } } else { - if (getGameType() == GType_SIMON2 && state->flags & kDFUseFrontBuf && getBitFlag(171)) { + if (state->flags & kDFUseFrontBuf) { state->surf_addr = state->surf2_addr; state->surf_pitch = state->surf2_pitch; } diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp index b2deaa1d87..97716bf3ee 100644 --- a/engines/agos/script_e1.cpp +++ b/engines/agos/script_e1.cpp @@ -123,7 +123,7 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) { op[128] = &AGOSEngine::o_if1; op[129] = &AGOSEngine::o_if2; - op[135] = &AGOSEngine::o_isCalled; + op[135] = &AGOSEngine::oe1_isCalled; op[136] = &AGOSEngine::o_is; op[152] = &AGOSEngine::o_debug; @@ -423,6 +423,13 @@ void AGOSEngine::oe1_pcName() { showMessageFormat("%s", name.c_str()); } +void AGOSEngine::oe1_isCalled() { + // 135: childstruct fr2 is + Item *item = getNextItemPtr(); + uint stringId = getNextStringID(); + setScriptCondition(!scumm_stricmp((const char *)getStringPtrByID(item->itemName), (const char *)getStringPtrByID(stringId))); +} + void AGOSEngine::oe1_cFlag() { // 162: check container flag SubContainer *c = (SubContainer *)findChildOfType(getNextItemPtr(), 7); @@ -549,10 +556,6 @@ void AGOSEngine::oe1_animate() { uint y = getVarOrWord(); uint palette = getVarOrWord(); - if (getGameType() == GType_SIMON1 && (getFeatures() & GF_TALKIE) && vgaSpriteId >= 400) { - _lastVgaWaitFor = 0; - } - _lockWord |= 0x40; animate(windowNum, vgaSpriteId / 100, vgaSpriteId, x, y, palette); _lockWord &= ~0x40; @@ -708,7 +711,7 @@ void AGOSEngine::oe1_printPlayerDamage() { window->flags = 1; mouseOff(); - writeChar(window, 36, 38, 2, _variableArray[441]); + writeChar(window, 36, 38, 2, _variableArray[241]); mouseOn(); } @@ -718,7 +721,7 @@ void AGOSEngine::oe1_printMonsterDamage() { window->flags = 1; mouseOff(); - writeChar(window, 36, 88, 2, _variableArray[442]); + writeChar(window, 36, 88, 2, _variableArray[242]); mouseOn(); } diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index d6cd21b984..bce478b0c6 100644 --- a/engines/agos/script_e2.cpp +++ b/engines/agos/script_e2.cpp @@ -46,6 +46,7 @@ void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) { op[73] = &AGOSEngine::oe2_pObj; op[74] = &AGOSEngine::oe1_pName; op[75] = &AGOSEngine::oe1_pcName; + op[79] = &AGOSEngine::oe1_isCalled; op[83] = &AGOSEngine::oe1_rescan; op[89] = &AGOSEngine::oe1_loadGame; op[94] = &AGOSEngine::oe1_findMaster; diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index 52d8e7deac..2ad67c70ee 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -542,16 +542,6 @@ int AGOSEngine::startSubroutine(Subroutine *sub) { if (++_recursionDepth > 40) error("Recursion error"); - // WORKAROUND: Bit Flag 171 isn't set when Simon rides the lion to the - // goblin camp in non-English versions. Bit Flag 171 is required to display - // the red trail between locations on the map, during the ride. - if (getGameType() == GType_SIMON2) { - if (sub->id == 13020) - setBitFlag(171, true); - if (sub->id == 13021) - setBitFlag(171, false); - } - _currentTable = sub; restart: while ((byte *)sl != (byte *)sub) { @@ -575,7 +565,6 @@ restart: } if (_classMode1) { - debug(0, "_classMode1"); _subjectItem = nextInByClass(_subjectItem, _classMask); if (!_subjectItem) { _classMode1 = 0; @@ -586,7 +575,6 @@ restart: } } if (_classMode2) { - debug(0, "_classMode2"); _objectItem = nextInByClass(_objectItem, _classMask); if (!_objectItem) { _classMode2 = 0; diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index b43d29d41d..2350d4f3e6 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -1087,8 +1087,11 @@ void AGOSEngine::vc33_setMouseOn() { } void AGOSEngine::vc34_setMouseOff() { - mouseOff(); - _mouseHideCount = 200; + // FIXME + if (getGameType() != GType_ELVIRA1) { + mouseOff(); + _mouseHideCount = 200; + } _leftButtonDown = 0; } -- cgit v1.2.3