Add more fixes for Elvira 1

svn-id: r24547
This commit is contained in:
Travis Howell 2006-10-28 03:29:58 +00:00
parent 10478617c6
commit 4b46821ffb
8 changed files with 40 additions and 44 deletions

View File

@ -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();

View File

@ -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

View File

@ -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",

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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;

View File

@ -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;

View File

@ -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;
}