[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
+15 -11
View File
@@ -1,15 +1,29 @@
/*
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#include <ox/logconn/logconn.hpp>
#include <nostalgia/core/core.hpp>
#include <nostalgia/foundation/media.hpp>
#include <nostalgia/appmodules/appmodules.hpp>
#include "app.hpp"
static ox::Error run(int argc, const char **argv) noexcept {
ox::trace::init();
nostalgia::loadModules();
if (argc < 2) {
oxErr("Please provide path to project directory or OxFS file.\n");
return OxError(1);
}
const auto path = argv[1];
oxRequireM(fs, nostalgia::foundation::loadRomFs(path));
return run(std::move(fs));
}
int main(int argc, const char **argv) {
#ifdef DEBUG
ox::LoggerConn loggerConn;
const auto loggerErr = loggerConn.initConn("Nostalgia Player");
@@ -19,16 +33,6 @@ static ox::Error run(int argc, const char **argv) noexcept {
ox::trace::setLogger(&loggerConn);
}
#endif
if (argc < 2) {
oxErr("Please provide path to project directory or OxFS file.\n");
return OxError(1);
}
const auto path = argv[1];
oxRequireM(fs, nostalgia::core::loadRomFs(path));
return run(std::move(fs));
}
int main(int argc, const char **argv) {
const auto err = run(argc, argv);
oxAssert(err, "Something went wrong...");
return static_cast<int>(err);