change float and default case dissasemble
This commit is contained in:
parent
f197fb160d
commit
c0580ef14a
@ -168,15 +168,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetFloat:
|
case opcode::OP_GetFloat:
|
||||||
{
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
const auto val = script_->read<float>();
|
|
||||||
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
@ -185,12 +182,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimation:
|
case opcode::OP_GetAnimation:
|
||||||
script_->seek(8);
|
script_->seek(8);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimTree:
|
case opcode::OP_GetAnimTree:
|
||||||
script_->seek(1);
|
script_->seek(1);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_waittillmatch:
|
case opcode::OP_waittillmatch:
|
||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||||
@ -376,7 +373,7 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
{
|
{
|
||||||
inst->data.push_back("default");
|
inst->data.push_back("default");
|
||||||
stack_->read<std::uint16_t>();
|
stack_->read_c_string();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -517,7 +514,7 @@ void disassembler::print_function(const function::ptr& func)
|
|||||||
print_instruction(inst);
|
print_instruction(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data()));
|
output_->write_string(utils::string::va("end_%s\n", func->name.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_instruction(const instruction::ptr& inst)
|
void disassembler::print_instruction(const instruction::ptr& inst)
|
||||||
|
@ -168,15 +168,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetFloat:
|
case opcode::OP_GetFloat:
|
||||||
{
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
const auto val = script_->read<float>();
|
|
||||||
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
@ -185,12 +182,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimation:
|
case opcode::OP_GetAnimation:
|
||||||
script_->seek(8);
|
script_->seek(8);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimTree:
|
case opcode::OP_GetAnimTree:
|
||||||
script_->seek(1);
|
script_->seek(1);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_waittillmatch:
|
case opcode::OP_waittillmatch:
|
||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||||
@ -376,7 +373,7 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
{
|
{
|
||||||
inst->data.push_back("default");
|
inst->data.push_back("default");
|
||||||
stack_->read<std::uint16_t>();
|
stack_->read_c_string();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -517,7 +514,7 @@ void disassembler::print_function(const function::ptr& func)
|
|||||||
print_instruction(inst);
|
print_instruction(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data()));
|
output_->write_string(utils::string::va("end_%s\n", func->name.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_instruction(const instruction::ptr& inst)
|
void disassembler::print_instruction(const instruction::ptr& inst)
|
||||||
|
@ -167,15 +167,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetFloat:
|
case opcode::OP_GetFloat:
|
||||||
{
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
const auto val = script_->read<float>();
|
|
||||||
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
@ -184,12 +181,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimation:
|
case opcode::OP_GetAnimation:
|
||||||
script_->seek(4);
|
script_->seek(4);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimTree:
|
case opcode::OP_GetAnimTree:
|
||||||
script_->seek(1);
|
script_->seek(1);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_waittillmatch:
|
case opcode::OP_waittillmatch:
|
||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||||
@ -375,7 +372,7 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
{
|
{
|
||||||
inst->data.push_back("default");
|
inst->data.push_back("default");
|
||||||
stack_->read<std::uint16_t>();
|
stack_->read_c_string();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -516,7 +513,7 @@ void disassembler::print_function(const function::ptr& func)
|
|||||||
print_instruction(inst);
|
print_instruction(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data()));
|
output_->write_string(utils::string::va("end_%s\n", func->name.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_instruction(const instruction::ptr& inst)
|
void disassembler::print_instruction(const instruction::ptr& inst)
|
||||||
|
@ -167,15 +167,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetFloat:
|
case opcode::OP_GetFloat:
|
||||||
{
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
const auto val = script_->read<float>();
|
|
||||||
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
@ -184,12 +181,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimation:
|
case opcode::OP_GetAnimation:
|
||||||
script_->seek(8);
|
script_->seek(8);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimTree:
|
case opcode::OP_GetAnimTree:
|
||||||
script_->seek(1);
|
script_->seek(1);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_waittillmatch:
|
case opcode::OP_waittillmatch:
|
||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||||
@ -375,7 +372,7 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
{
|
{
|
||||||
inst->data.push_back("default");
|
inst->data.push_back("default");
|
||||||
stack_->read<std::uint16_t>();
|
stack_->read_c_string();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -516,7 +513,7 @@ void disassembler::print_function(const function::ptr& func)
|
|||||||
print_instruction(inst);
|
print_instruction(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data()));
|
output_->write_string(utils::string::va("end_%s\n", func->name.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_instruction(const instruction::ptr& inst)
|
void disassembler::print_instruction(const instruction::ptr& inst)
|
||||||
|
@ -167,15 +167,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetFloat:
|
case opcode::OP_GetFloat:
|
||||||
{
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
const auto val = script_->read<float>();
|
|
||||||
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
@ -184,12 +181,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimation:
|
case opcode::OP_GetAnimation:
|
||||||
script_->seek(8);
|
script_->seek(8);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimTree:
|
case opcode::OP_GetAnimTree:
|
||||||
script_->seek(1);
|
script_->seek(1);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_waittillmatch:
|
case opcode::OP_waittillmatch:
|
||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||||
@ -375,7 +372,7 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
{
|
{
|
||||||
inst->data.push_back("default");
|
inst->data.push_back("default");
|
||||||
stack_->read<std::uint16_t>();
|
stack_->read_c_string();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -516,7 +513,7 @@ void disassembler::print_function(const function::ptr& func)
|
|||||||
print_instruction(inst);
|
print_instruction(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data()));
|
output_->write_string(utils::string::va("end_%s\n", func->name.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_instruction(const instruction::ptr& inst)
|
void disassembler::print_instruction(const instruction::ptr& inst)
|
||||||
|
@ -183,9 +183,9 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
|
@ -168,15 +168,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetFloat:
|
case opcode::OP_GetFloat:
|
||||||
{
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
const auto val = script_->read<float>();
|
|
||||||
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
@ -185,12 +182,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimation:
|
case opcode::OP_GetAnimation:
|
||||||
script_->seek(8);
|
script_->seek(8);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimTree:
|
case opcode::OP_GetAnimTree:
|
||||||
script_->seek(1);
|
script_->seek(1);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_waittillmatch:
|
case opcode::OP_waittillmatch:
|
||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||||
@ -376,7 +373,7 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
{
|
{
|
||||||
inst->data.push_back("default");
|
inst->data.push_back("default");
|
||||||
stack_->read<std::uint16_t>();
|
stack_->read_c_string();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -517,7 +514,7 @@ void disassembler::print_function(const function::ptr& func)
|
|||||||
print_instruction(inst);
|
print_instruction(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data()));
|
output_->write_string(utils::string::va("end_%s\n", func->name.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_instruction(const instruction::ptr& inst)
|
void disassembler::print_instruction(const instruction::ptr& inst)
|
||||||
|
@ -169,15 +169,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetFloat:
|
case opcode::OP_GetFloat:
|
||||||
{
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
const auto val = script_->read<float>();
|
|
||||||
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
@ -186,12 +183,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimation:
|
case opcode::OP_GetAnimation:
|
||||||
script_->seek(8);
|
script_->seek(8);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimTree:
|
case opcode::OP_GetAnimTree:
|
||||||
script_->seek(1);
|
script_->seek(1);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_waittillmatch:
|
case opcode::OP_waittillmatch:
|
||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||||
@ -377,7 +374,7 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
{
|
{
|
||||||
inst->data.push_back("default");
|
inst->data.push_back("default");
|
||||||
stack_->read<std::uint16_t>();
|
stack_->read_c_string();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -518,7 +515,7 @@ void disassembler::print_function(const function::ptr& func)
|
|||||||
print_instruction(inst);
|
print_instruction(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data()));
|
output_->write_string(utils::string::va("end_%s\n", func->name.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_instruction(const instruction::ptr& inst)
|
void disassembler::print_instruction(const instruction::ptr& inst)
|
||||||
|
@ -180,15 +180,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetFloat:
|
case opcode::OP_GetFloat:
|
||||||
{
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
const auto val = script_->read<float>();
|
|
||||||
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetVector:
|
case opcode::OP_GetVector:
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
inst->data.push_back(utils::string::va("%g", script_->read<float>()));
|
inst->data.push_back(utils::string::float_string(script_->read<float>()));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetString:
|
case opcode::OP_GetString:
|
||||||
case opcode::OP_GetIString:
|
case opcode::OP_GetIString:
|
||||||
@ -197,12 +194,12 @@ void disassembler::dissasemble_instruction(const instruction::ptr& inst)
|
|||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimation:
|
case opcode::OP_GetAnimation:
|
||||||
script_->seek(8);
|
script_->seek(8);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_GetAnimTree:
|
case opcode::OP_GetAnimTree:
|
||||||
script_->seek(1);
|
script_->seek(1);
|
||||||
inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
break;
|
break;
|
||||||
case opcode::OP_waittillmatch:
|
case opcode::OP_waittillmatch:
|
||||||
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
inst->data.push_back(utils::string::va("%i", script_->read<std::uint8_t>()));
|
||||||
@ -428,7 +425,7 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
{
|
{
|
||||||
inst->data.push_back("default");
|
inst->data.push_back("default");
|
||||||
stack_->read<std::uint16_t>();
|
stack_->read_c_string();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -582,7 +579,7 @@ void disassembler::print_function(const function::ptr& func)
|
|||||||
print_instruction(inst);
|
print_instruction(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data()));
|
output_->write_string(utils::string::va("end_%s\n", func->name.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_instruction(const instruction::ptr& inst)
|
void disassembler::print_instruction(const instruction::ptr& inst)
|
||||||
|
Loading…
Reference in New Issue
Block a user