SCUMM: o5_ifNotState and o5_ifState are actually not part of v5, only in v3 & v4 -> renamed and moved them accordingly

svn-id: r40013
This commit is contained in:
Max Horn 2009-04-19 01:01:28 +00:00
parent 57c624b24d
commit 0e82403daa
4 changed files with 39 additions and 34 deletions

View File

@ -45,6 +45,35 @@ void ScummEngine_v4::setupOpcodes() {
OPCODE(0x5c, o4_oldRoomEffect);
OPCODE(0xdc, o4_oldRoomEffect);
OPCODE(0x0f, o4_ifState);
OPCODE(0x2f, o4_ifNotState);
OPCODE(0x4f, o4_ifState);
OPCODE(0x6f, o4_ifNotState);
OPCODE(0x8f, o4_ifState);
OPCODE(0xaf, o4_ifNotState);
OPCODE(0xcf, o4_ifState);
OPCODE(0xef, o4_ifNotState);
}
void ScummEngine_v4::o4_ifState() {
int a = getVarOrDirectWord(PARAM_1);
int b = getVarOrDirectByte(PARAM_2);
if (getState(a) != b)
o5_jumpRelative();
else
ignoreScriptWord();
}
void ScummEngine_v4::o4_ifNotState() {
int a = getVarOrDirectWord(PARAM_1);
int b = getVarOrDirectByte(PARAM_2);
if (getState(a) == b)
o5_jumpRelative();
else
ignoreScriptWord();
}
void ScummEngine_v4::o4_pickupObject() {

View File

@ -98,7 +98,7 @@ void ScummEngine_v5::setupOpcodes() {
OPCODE(0x2c, o5_cursorCommand);
OPCODE(0x2d, o5_putActorInRoom);
OPCODE(0x2e, o5_delay);
OPCODE(0x2f, o5_ifNotState);
// OPCODE(0x2f, o5_ifNotState);
/* 30 */
OPCODE(0x30, o5_matrixOps);
OPCODE(0x31, o5_getInventoryCount);
@ -138,7 +138,7 @@ void ScummEngine_v5::setupOpcodes() {
OPCODE(0x4c, o5_soundKludge);
OPCODE(0x4d, o5_walkActorToActor);
OPCODE(0x4e, o5_putActorAtObject);
OPCODE(0x4f, o5_ifState);
// OPCODE(0x4f, o5_ifState);
/* 50 */
// OPCODE(0x50, o5_pickupObjectOld);
OPCODE(0x51, o5_animateActor);
@ -178,7 +178,7 @@ void ScummEngine_v5::setupOpcodes() {
OPCODE(0x6c, o5_getActorWidth);
OPCODE(0x6d, o5_putActorInRoom);
OPCODE(0x6e, o5_stopObjectScript);
OPCODE(0x6f, o5_ifNotState);
// OPCODE(0x6f, o5_ifNotState);
/* 70 */
OPCODE(0x70, o5_lights);
OPCODE(0x71, o5_getActorCostume);
@ -258,7 +258,7 @@ void ScummEngine_v5::setupOpcodes() {
OPCODE(0xac, o5_expression);
OPCODE(0xad, o5_putActorInRoom);
OPCODE(0xae, o5_wait);
OPCODE(0xaf, o5_ifNotState);
// OPCODE(0xaf, o5_ifNotState);
/* B0 */
OPCODE(0xb0, o5_matrixOps);
OPCODE(0xb1, o5_getInventoryCount);
@ -298,7 +298,7 @@ void ScummEngine_v5::setupOpcodes() {
OPCODE(0xcc, o5_pseudoRoom);
OPCODE(0xcd, o5_walkActorToActor);
OPCODE(0xce, o5_putActorAtObject);
OPCODE(0xcf, o5_ifState);
// OPCODE(0xcf, o5_ifState);
/* D0 */
// OPCODE(0xd0, o5_pickupObjectOld);
OPCODE(0xd1, o5_animateActor);
@ -338,7 +338,7 @@ void ScummEngine_v5::setupOpcodes() {
OPCODE(0xec, o5_getActorWidth);
OPCODE(0xed, o5_putActorInRoom);
OPCODE(0xee, o5_stopObjectScript);
OPCODE(0xef, o5_ifNotState);
// OPCODE(0xef, o5_ifNotState);
/* F0 */
OPCODE(0xf0, o5_lights);
OPCODE(0xf1, o5_getActorCostume);
@ -1407,32 +1407,8 @@ void ScummEngine_v5::o5_getObjectOwner() {
}
void ScummEngine_v5::o5_getObjectState() {
if (_game.features & GF_SMALL_HEADER) {
o5_ifState();
} else {
getResultPos();
setResult(getState(getVarOrDirectWord(PARAM_1)));
}
}
void ScummEngine_v5::o5_ifState() {
int a = getVarOrDirectWord(PARAM_1);
int b = getVarOrDirectByte(PARAM_2);
if (getState(a) != b)
o5_jumpRelative();
else
ignoreScriptWord();
}
void ScummEngine_v5::o5_ifNotState() {
int a = getVarOrDirectWord(PARAM_1);
int b = getVarOrDirectByte(PARAM_2);
if (getState(a) == b)
o5_jumpRelative();
else
ignoreScriptWord();
getResultPos();
setResult(getState(getVarOrDirectWord(PARAM_1)));
}
void ScummEngine_v5::o5_getRandomNr() {

View File

@ -52,6 +52,8 @@ protected:
virtual void resetRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL);
/* Version 4 script opcodes */
void o4_ifState();
void o4_ifNotState();
void o4_oldRoomEffect();
void o4_pickupObject();
};

View File

@ -136,8 +136,6 @@ protected:
void o5_getStringWidth();
void o5_getVerbEntrypoint();
void o5_ifClassOfIs();
void o5_ifNotState();
void o5_ifState();
void o5_increment();
void o5_isActorInBox();
void o5_isEqual();