fix(iw9): default case & gen hash map
This commit is contained in:
parent
79759d91ab
commit
8bc4bec600
@ -339,6 +339,11 @@ void disassembler::disassemble_builtin_call(const instruction::ptr& inst, bool m
|
|||||||
if (str.starts_with("#xS"))
|
if (str.starts_with("#xS"))
|
||||||
{
|
{
|
||||||
str = resolver::hash_name(std::stoull(str.substr(3), 0 ,16));
|
str = resolver::hash_name(std::stoull(str.substr(3), 0 ,16));
|
||||||
|
|
||||||
|
if (str.starts_with("id_"))
|
||||||
|
{
|
||||||
|
str = "builtin_" + str;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
script_->seek(2);
|
script_->seek(2);
|
||||||
@ -420,24 +425,20 @@ void disassembler::disassemble_end_switch(const instruction::ptr& inst)
|
|||||||
const auto byte = script_->read<std::uint8_t>();
|
const auto byte = script_->read<std::uint8_t>();
|
||||||
|
|
||||||
if (byte == 2)
|
if (byte == 2)
|
||||||
{
|
|
||||||
auto str = stack_->read_c_string();
|
|
||||||
|
|
||||||
if (str[0] == 1)
|
|
||||||
{
|
|
||||||
inst->data.push_back("default");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
inst->data.push_back("case");
|
inst->data.push_back("case");
|
||||||
inst->data.push_back(utils::string::quote(str, false));
|
inst->data.push_back(utils::string::quote(stack_->read_c_string(), false));
|
||||||
}
|
}
|
||||||
}
|
else if (byte == 1)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
inst->data.push_back("case");
|
inst->data.push_back("case");
|
||||||
inst->data.push_back(utils::string::va("%i", value));
|
inst->data.push_back(utils::string::va("%i", value));
|
||||||
}
|
}
|
||||||
|
else // byte == 0
|
||||||
|
{
|
||||||
|
//default = value 0 and byte 0 and i = 1
|
||||||
|
inst->data.push_back("default");
|
||||||
|
}
|
||||||
|
|
||||||
const auto addr = index + 4 + offs;
|
const auto addr = index + 4 + offs;
|
||||||
const auto label = utils::string::va("loc_%X", addr);
|
const auto label = utils::string::va("loc_%X", addr);
|
||||||
|
74969
src/iw9/xsk/resolver.cpp
74969
src/iw9/xsk/resolver.cpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user