[keel,nostalgia,turbine] Cleanup

This commit is contained in:
2023-11-23 01:46:11 -06:00
parent a84a829769
commit b946e428ad
30 changed files with 120 additions and 122 deletions
-1
View File
@@ -4,7 +4,6 @@ target_link_libraries(
nost-pack
OxClArgs
OxLogConn
Keel
NostalgiaKeelModules
)
+4 -12
View File
@@ -6,6 +6,7 @@
#include <ox/clargs/clargs.hpp>
#include <ox/fs/fs.hpp>
#include <ox/logconn/def.hpp>
#include <ox/logconn/logconn.hpp>
#include <keel/keel.hpp>
@@ -50,7 +51,6 @@ static ox::Error generateTypes(ox::TypeStore *ts) noexcept {
}
static ox::Error run(const ox::ClArgs &args) noexcept {
nostalgia::registerKeelModules();
const auto argSrc = args.getString("src", "");
const auto argRomBin = args.getString("rom-bin", "");
if (argSrc == "") {
@@ -63,7 +63,7 @@ static ox::Error run(const ox::ClArgs &args) noexcept {
}
ox::Buffer dstBuff(32 * ox::units::MB);
oxReturnError(ox::FileSystem32::format(dstBuff.data(), dstBuff.size()));
ox::FileSystem32 dst(ox::FileStore32(dstBuff.data(), dstBuff.size()));
ox::FileSystem32 dst(dstBuff);
oxRequire(ctx, keel::init(ox::make_unique<ox::PassThroughFS>(argSrc), "nost-pack"));
keel::TypeStore ts(ctx->rom.get(), "/.nostalgia/type_descriptors");
oxReturnError(generateTypes(&ts));
@@ -87,16 +87,8 @@ static ox::Error run(const ox::ClArgs &args) noexcept {
}
int main(int argc, const char **args) {
ox::trace::init();
#ifdef DEBUG
ox::LoggerConn loggerConn;
const auto loggerErr = loggerConn.initConn("nost-pack");
if (loggerErr) {
oxErrf("Could not connect to logger: {} ({}:{})\n", toStr(loggerErr), loggerErr.file, loggerErr.line);
} else {
ox::trace::setLogger(&loggerConn);
}
#endif
OX_INIT_DEBUG_LOGGER(loggerConn, "nost-pack")
nostalgia::registerKeelModules();
const auto err = run(ox::ClArgs(argc, args));
oxAssert(err, "pack failed");
return static_cast<int>(err);