[nostalgia] Split part of Core out into Foundation, add module system

This commit is contained in:
2023-02-03 00:41:24 -06:00
parent 83589287bc
commit 7868b0678f
50 changed files with 742 additions and 470 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#include <ox/claw/read.hpp>
@@ -8,9 +8,9 @@
#include <ox/model/modelvalue.hpp>
#include <nostalgia/core/gfx.hpp>
#include <nostalgia/core/media.hpp>
#include <nostalgia/core/typeconv.hpp>
#include <nostalgia/core/typestore.hpp>
#include <nostalgia/foundation/media.hpp>
#include "pack.hpp"
@@ -64,7 +64,7 @@ static ox::Error doTransformations(core::TypeStore *ts, ox::FileSystem *dest, ox
oxRequire(s, dest->stat(filePath));
oxRequireM(buff, dest->read(s.inode));
if (endsWith(filePath, ".ng")) {
oxReturnError(core::convertBuffToBuff<core::CompactTileSheet>(buff, ox::ClawFormat::Metal).moveTo(&buff));
oxReturnError(foundation::convertBuffToBuff<core::CompactTileSheet>(nullptr, buff, ox::ClawFormat::Metal).moveTo(&buff));
}
oxRequireM(obj, ox::readClaw(ts, buff));
// do transformations
@@ -153,7 +153,7 @@ static ox::Error preloadObj(core::TypeStore *ts, ox::FileSystem *romFs, GbaPrelo
const auto err = ox::preload<GbaPlatSpec, decltype(obj)>(pl, &obj);
oxReturnError(pl->endAlloc());
oxReturnError(err);
const core::PreloadPtr p{.preloadAddr = static_cast<uint32_t>(a)};
const foundation::PreloadPtr p{.preloadAddr = static_cast<uint32_t>(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