MYST3: Implement Xbox specific opcode 77

This commit is contained in:
Bastien Bouclet 2014-09-07 18:50:28 +02:00
parent 3f882cc7e1
commit 4daa591360
2 changed files with 15 additions and 0 deletions

View File

@ -1126,6 +1126,20 @@ void Script::varDecrementMin(Context &c, const Opcode &cmd) {
_vm->_state->setVar(cmd.args[0], value); _vm->_state->setVar(cmd.args[0], value);
} }
void Script::varDecrementMinLooping(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Decrement var %d in range [%d, %d]",
cmd.op, cmd.args[0], cmd.args[1], cmd.args[2]);
int32 value = _vm->_state->getVar(cmd.args[0]);
value--;
if (value < cmd.args[1])
value = cmd.args[2];
_vm->_state->setVar(cmd.args[0], value);
}
void Script::varAddValueMax(Context &c, const Opcode &cmd) { void Script::varAddValueMax(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Add value %d to var %d with max value %d", debugC(kDebugScript, "Opcode %d: Add value %d to var %d with max value %d",
cmd.op, cmd.args[0], cmd.args[1], cmd.args[2]); cmd.op, cmd.args[0], cmd.args[1], cmd.args[2]);

View File

@ -176,6 +176,7 @@ private:
DECLARE_OPCODE(varAddValueMaxLooping); DECLARE_OPCODE(varAddValueMaxLooping);
DECLARE_OPCODE(varDecrement); DECLARE_OPCODE(varDecrement);
DECLARE_OPCODE(varDecrementMin); DECLARE_OPCODE(varDecrementMin);
DECLARE_OPCODE(varDecrementMinLooping);
DECLARE_OPCODE(varAddValueMax); DECLARE_OPCODE(varAddValueMax);
DECLARE_OPCODE(varSubValueMin); DECLARE_OPCODE(varSubValueMin);
DECLARE_OPCODE(varZeroRange); DECLARE_OPCODE(varZeroRange);