From 0d040ad752edd3d7d2099bc80bb9bf67a90de174 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 17 Dec 2022 13:41:59 -0600 Subject: [PATCH] [nostalgia/tools/pack] Add PtrSize to GbaPlatSpec --- src/nostalgia/tools/pack/pack.cpp | 6 +++--- src/nostalgia/tools/pack/pack.hpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nostalgia/tools/pack/pack.cpp b/src/nostalgia/tools/pack/pack.cpp index 424abeb9..0944d688 100644 --- a/src/nostalgia/tools/pack/pack.cpp +++ b/src/nostalgia/tools/pack/pack.cpp @@ -149,11 +149,11 @@ 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(&obj))); - auto err = ox::preload(pl, &obj); + oxRequire(a, pl->startAlloc(ox::sizeOf(&obj))); + const auto err = ox::preload(pl, &obj); oxReturnError(pl->endAlloc()); oxReturnError(err); - const core::PreloadPtr p{.preloadAddr = 0}; + const core::PreloadPtr p{.preloadAddr = static_cast(a)}; oxReturnError(ox::writeMC(&p).moveTo(&buff)); } else { // strip the Claw header (it is not needed after preloading) and write back out to dest fs diff --git a/src/nostalgia/tools/pack/pack.hpp b/src/nostalgia/tools/pack/pack.hpp index 56885538..48b411d1 100644 --- a/src/nostalgia/tools/pack/pack.hpp +++ b/src/nostalgia/tools/pack/pack.hpp @@ -14,6 +14,7 @@ struct GbaPlatSpec { using PtrType = uint32_t; using size_t = uint32_t; + static constexpr auto PtrSize = 4; static constexpr auto PtrAlign = 4; static constexpr PtrType RomStart = 0x08000000;