[nostalgia/tools/pack] Wrap preload operations with start/end allocs

This commit is contained in:
Gary Talent 2022-12-03 01:54:53 -06:00
parent ab8b1e4925
commit 86cbf66699

View File

@ -149,7 +149,9 @@ static ox::Error preloadObj(core::TypeStore *ts, ox::FileSystem *romFs, GbaPrelo
oxRequireM(obj, ox::readClaw(ts, buff));
if (obj.type()->preloadable) {
// preload
oxReturnError(pl->startAlloc(ox::sizeOf<GbaPlatSpec>(&obj)));
auto err = ox::preload<GbaPlatSpec, decltype(obj)>(pl, &obj);
oxReturnError(pl->endAlloc());
oxReturnError(err);
const core::PreloadPtr p{.preloadAddr = 0};
oxReturnError(ox::writeMC(&p).moveTo(&buff));