feat(arc): add optional arg for filename in gscobj header (#153)
This commit is contained in:
parent
898e575978
commit
834e4023f5
@ -25,7 +25,7 @@ class assembler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
assembler(context const* ctx);
|
assembler(context const* ctx);
|
||||||
auto assemble(assembly const& data) -> buffer;
|
auto assemble(assembly const& data, std::string const& name = {}) -> buffer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
auto assemble_function(function& func) -> void;
|
auto assemble_function(function& func) -> void;
|
||||||
|
@ -14,7 +14,7 @@ assembler::assembler(context const* ctx) : ctx_{ ctx }, script_{ ctx->endian() =
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
auto assembler::assemble(assembly const& data) -> buffer
|
auto assembler::assemble(assembly const& data, std::string const& name) -> buffer
|
||||||
{
|
{
|
||||||
assembly_ = &data;
|
assembly_ = &data;
|
||||||
script_.clear();
|
script_.clear();
|
||||||
@ -26,7 +26,7 @@ auto assembler::assemble(assembly const& data) -> buffer
|
|||||||
auto head = header{};
|
auto head = header{};
|
||||||
|
|
||||||
script_.pos((ctx_->props() & props::headerxx) ? 0 : (ctx_->props() & props::header72) ? 72 : 64);
|
script_.pos((ctx_->props() & props::headerxx) ? 0 : (ctx_->props() & props::header72) ? 72 : 64);
|
||||||
process_string("");
|
process_string(name);
|
||||||
|
|
||||||
for (auto const& func : assembly_->functions)
|
for (auto const& func : assembly_->functions)
|
||||||
{
|
{
|
||||||
@ -183,7 +183,7 @@ auto assembler::assemble(assembly const& data) -> buffer
|
|||||||
head.profile_count = 0;
|
head.profile_count = 0;
|
||||||
|
|
||||||
head.flags = 0;
|
head.flags = 0;
|
||||||
head.name = resolve_string("");
|
head.name = resolve_string(name);
|
||||||
|
|
||||||
auto endpos = script_.pos();
|
auto endpos = script_.pos();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user