feature(gsc): instance & iw9 path (#73)
This commit is contained in:
parent
9c08cbd8c6
commit
c515ef6890
@ -362,8 +362,12 @@ auto assembler::assemble_far_call(instruction const& inst, bool thread) -> void
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
auto path = inst.data[0];
|
||||||
|
if (!path.starts_with("_id_"))
|
||||||
|
path.append(ctx_->instance() == instance::server ? ".gsc" : ".csc");
|
||||||
|
|
||||||
script_.write<u32>(0);
|
script_.write<u32>(0);
|
||||||
stack_.write<u64>(ctx_->hash_id(inst.data[0]));
|
stack_.write<u64>(ctx_->path_id(path));
|
||||||
stack_.write<u64>(ctx_->hash_id(inst.data[1]));
|
stack_.write<u64>(ctx_->hash_id(inst.data[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ namespace xsk::gsc
|
|||||||
extern std::array<std::pair<opcode, std::string_view>, opcode_count> const opcode_list;
|
extern std::array<std::pair<opcode, std::string_view>, opcode_count> const opcode_list;
|
||||||
|
|
||||||
context::context(gsc::props props, gsc::engine engine, gsc::endian endian, gsc::system system, u32 str_count)
|
context::context(gsc::props props, gsc::engine engine, gsc::endian endian, gsc::system system, u32 str_count)
|
||||||
: props_{ props }, engine_{ engine }, endian_{ endian }, system_{ system }, str_count_{ str_count },
|
: props_{ props }, engine_{ engine }, endian_{ endian }, system_{ system }, instance_{ gsc::instance::server }, str_count_{ str_count },
|
||||||
source_{ this }, assembler_{ this }, disassembler_{ this }, compiler_{ this }, decompiler_{ this }
|
source_{ this }, assembler_{ this }, disassembler_{ this }, compiler_{ this }, decompiler_{ this }
|
||||||
{
|
{
|
||||||
opcode_map_.reserve(opcode_list.size());
|
opcode_map_.reserve(opcode_list.size());
|
||||||
@ -409,8 +409,6 @@ auto context::func_exists(std::string const& name) const -> bool
|
|||||||
{
|
{
|
||||||
return func_map_rev_.contains(name);
|
return func_map_rev_.contains(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto context::func_add(std::string const& name, u16 id) -> void
|
auto context::func_add(std::string const& name, u16 id) -> void
|
||||||
@ -520,8 +518,6 @@ auto context::meth_exists(std::string const& name) const -> bool
|
|||||||
{
|
{
|
||||||
return meth_map_rev_.contains(name);
|
return meth_map_rev_.contains(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto context::meth_add(std::string const& name, u16 id) -> void
|
auto context::meth_add(std::string const& name, u16 id) -> void
|
||||||
|
@ -32,6 +32,8 @@ public:
|
|||||||
|
|
||||||
auto system() const -> system { return system_; }
|
auto system() const -> system { return system_; }
|
||||||
|
|
||||||
|
auto instance() const -> instance { return instance_; }
|
||||||
|
|
||||||
auto str_count() const -> u32 { return str_count_; }
|
auto str_count() const -> u32 { return str_count_; }
|
||||||
|
|
||||||
auto source() -> source& { return source_; }
|
auto source() -> source& { return source_; }
|
||||||
@ -115,6 +117,7 @@ protected:
|
|||||||
gsc::engine engine_;
|
gsc::engine engine_;
|
||||||
gsc::endian endian_;
|
gsc::endian endian_;
|
||||||
gsc::system system_;
|
gsc::system system_;
|
||||||
|
gsc::instance instance_;
|
||||||
u32 str_count_;
|
u32 str_count_;
|
||||||
gsc::source source_;
|
gsc::source source_;
|
||||||
gsc::assembler assembler_;
|
gsc::assembler assembler_;
|
||||||
|
@ -21,6 +21,12 @@
|
|||||||
namespace xsk::gsc
|
namespace xsk::gsc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
enum class instance : u8
|
||||||
|
{
|
||||||
|
server,
|
||||||
|
client,
|
||||||
|
};
|
||||||
|
|
||||||
enum class build : u8
|
enum class build : u8
|
||||||
{
|
{
|
||||||
dev,
|
dev,
|
||||||
|
@ -509,11 +509,11 @@ auto preprocessor::read_directive_define(token&) -> void
|
|||||||
throw ppr_error(next.pos, "variadic macros not supported");
|
throw ppr_error(next.pos, "variadic macros not supported");
|
||||||
//
|
//
|
||||||
|
|
||||||
if (!last_comma || last_elips)
|
// if (!last_comma || last_elips)
|
||||||
throw ppr_error(next.pos, "misplaced elipsis in macro param list");
|
// throw ppr_error(next.pos, "misplaced elipsis in macro param list");
|
||||||
|
|
||||||
last_elips = true;
|
// last_elips = true;
|
||||||
last_comma = false;
|
// last_comma = false;
|
||||||
}
|
}
|
||||||
else if (next.type == token::COMMA)
|
else if (next.type == token::COMMA)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user