Exemplo n.º 1
0
void Opcode80C2Handler::_run()
{
    Logger::debug("SCRIPT") << "[80C2] [*] LVAR[num] = value" << std::endl;
    auto value = _vm->dataStack()->pop();
    unsigned int num = _vm->dataStack()->popInteger();
    while (num >= _vm->LVARS()->size()) 
    {
        _vm->LVARS()->push_back(VMStackValue(0));
    }
    _vm->LVARS()->at(num) = value;
}
Exemplo n.º 2
0
void Opcode8016Handler::_run()
{
    auto name = _vm->dataStack()->popString();
    auto EVARS = Game::getInstance()->locationState()->EVARS();
    if (EVARS->find(name) == EVARS->end())
    {
        EVARS->insert(std::make_pair(name, VMStackValue(0)));
    }
    Logger::debug("SCRIPT") << "[8016] [*] op_export_var(name)" << std::endl
                            << "    name: " << name << std::endl;
}
Exemplo n.º 3
0
void OpcodeC001Handler::_run()
{
    int value;
    *(_vm->script()) >> value;

    // Skip 4 bytes for readed integer value
    _vm->setProgramCounter(_vm->programCounter() + 4);
    _vm->dataStack()->push(VMStackValue(value));

    auto& debug = Logger::debug("SCRIPT");
    debug << "[C001] [*] push_d integer" << std::endl;
    debug << "    value: " << std::to_string(value) << std::endl;
}
Exemplo n.º 4
0
void OpcodeA001Handler::_run()
{
    union {
        unsigned int iValue;
        float fValue;
    } uValue;
    *(_vm->script()) >> uValue.iValue;

    // Skip 4 bytes for read float value
    _vm->setProgramCounter(_vm->programCounter() + 4);
    _vm->dataStack()->push(VMStackValue(uValue.fValue));

    auto& debug = Logger::debug("SCRIPT");
    debug << "[A001] [*] push_d float" << std::endl;
    debug << "    value: " << std::to_string(uValue.fValue) << std::endl;
}