diff --git a/src/nostalgia/tools/pack.cpp b/src/nostalgia/tools/pack.cpp index ecf7bab9..8968c170 100644 --- a/src/nostalgia/tools/pack.cpp +++ b/src/nostalgia/tools/pack.cpp @@ -58,11 +58,10 @@ static ox::Error run(const ox::ClArgs &args) noexcept { } ox::Buffer dstBuff(32 * ox::units::MB); oxReturnError(ox::FileSystem32::format(dstBuff.data(), dstBuff.size())); - auto src = ox::make_unique(argSrc); ox::FileSystem32 dst(ox::FileStore32(dstBuff.data(), dstBuff.size())); - core::TypeStore ts(src.get()); - auto ctx = foundation::init(std::move(src), "nost-pack"); - oxReturnError(pack(ctx.get(), &ts, ctx->rom.get(), &dst)); + const auto ctx = foundation::init(ox::make_unique(argSrc), "nost-pack"); + core::TypeStore ts(ctx->rom.get()); + oxReturnError(pack(ctx.get(), &ts, &dst)); oxRequireM(pl, GbaPreloader::make()); oxReturnError(preload(&ts, &dst, pl.get())); oxReturnError(dst.resize()); diff --git a/src/nostalgia/tools/pack/pack.cpp b/src/nostalgia/tools/pack/pack.cpp index 8f036860..ac930dd0 100644 --- a/src/nostalgia/tools/pack/pack.cpp +++ b/src/nostalgia/tools/pack/pack.cpp @@ -204,8 +204,8 @@ ox::Error appendBinary(ox::Buffer *binBuff, ox::Buffer *fsBuff, GbaPreloader *pl return {}; } -ox::Error pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *src, ox::FileSystem *dest) noexcept { - oxReturnError(copy(src, dest, "/")); +ox::Error pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *dest) noexcept { + oxReturnError(copy(ctx->rom.get(), dest, "/")); oxReturnError(ox::buildTypeDef(ts)); oxReturnError(transformClaw(ctx, ts, dest, "/")); return {}; diff --git a/src/nostalgia/tools/pack/pack.hpp b/src/nostalgia/tools/pack/pack.hpp index 9a668713..0d4690ae 100644 --- a/src/nostalgia/tools/pack/pack.hpp +++ b/src/nostalgia/tools/pack/pack.hpp @@ -95,7 +95,7 @@ using GbaPreloader = ox::Preloader; ox::Error appendBinary(ox::Buffer *binBuff, ox::Buffer *fsBuff, GbaPreloader *pl) noexcept; -auto pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *src, ox::FileSystem *dest) noexcept -> ox::Error; +auto pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *dest) noexcept -> ox::Error; auto preload(core::TypeStore *ts, ox::FileSystem *src, GbaPreloader *ph) noexcept -> ox::Error;