AGI: Add last undefined V1 test command that tests if a bit of var is set

Also fix skipInstruction() for V1.
This commit is contained in:
Jussi Pitkanen 2011-06-17 16:07:43 +03:00 committed by Eugene Sandulenko
parent 2289ba88b6
commit e4a1193d22
3 changed files with 8 additions and 3 deletions

View file

@ -155,6 +155,10 @@ void condSaid3(AgiGame *state, uint8 *p) {
state->testResult = true;
}
void condBit(AgiGame *state, uint8 *p) {
state->testResult = (getvar(p[1]) >> p[0]) & 1;
}
void condCompareStrings(AgiGame *state, uint8 *p) {
debugC(7, kDebugLevelScripts, "comparing [%s], [%s]", state->strings[p[0]], state->strings[p[1]]);
state->testResult = state->_vm->testCompareStrings(p[0], p[1]);
@ -446,7 +450,7 @@ void AgiEngine::skipInstruction(byte op) {
AgiGame *state = &_game;
if (op >= 0xFC)
return;
if (op == 0x0E) // said
if (op == 0x0E && state->_vm->getVersion() >= 0x2000) // said
ip += *(code + ip) * 2 + 1;
else
ip += logicNamesTest[op].argumentsLength();

View file

@ -45,7 +45,7 @@ AgiInstruction insV1Test[] = {
{ "said", "nnnnnn", &condSaid3 }, // 0D
{ "have.key", "", &condHaveKey }, // 0E
{ "said", "nn", &condSaid1 }, // 0F
{ "bit", "nv", &condUnknown }, // 10
{ "bit", "nv", &condBit }, // 10
};
AgiInstruction insV1[] = {

View file

@ -249,6 +249,7 @@ void condIsSetV1(AgiGame *state, uint8 *p);
void condSaid1(AgiGame *state, uint8 *p);
void condSaid2(AgiGame *state, uint8 *p);
void condSaid3(AgiGame *state, uint8 *p);
void condBit(AgiGame *state, uint8 *p);
} // End of namespace Agi