2021-01-02 23:22:45 +00:00
|
|
|
//#include <stdio.h>
|
|
|
|
//#include <stdlib.h>
|
2020-09-20 01:21:28 +01:00
|
|
|
#include <string>
|
|
|
|
#include <switch.h>
|
|
|
|
#include <borealis.hpp>
|
|
|
|
#include "main_frame.hpp"
|
|
|
|
#include "constants.hpp"
|
|
|
|
#include "utils.hpp"
|
2021-02-11 12:45:35 +00:00
|
|
|
#include "current_cfw.hpp"
|
2021-02-16 00:46:39 +00:00
|
|
|
#include "warning_page.hpp"
|
|
|
|
#include <filesystem>
|
2021-03-14 15:24:56 +00:00
|
|
|
#include "json.hpp"
|
|
|
|
#include <constants.hpp>
|
2020-10-05 23:53:12 +01:00
|
|
|
|
|
|
|
namespace i18n = brls::i18n;
|
|
|
|
using namespace i18n::literals;
|
|
|
|
|
2021-01-02 23:22:45 +00:00
|
|
|
//TimeServiceType __nx_time_service_type = TimeServiceType_System;
|
2020-12-27 17:11:40 +00:00
|
|
|
|
2021-02-12 22:20:16 +00:00
|
|
|
const CFW running_cfw = getCFW();
|
2021-02-11 12:45:35 +00:00
|
|
|
|
2020-09-20 01:21:28 +01:00
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
// Init the app
|
|
|
|
if (!brls::Application::init(APP_TITLE))
|
|
|
|
{
|
|
|
|
brls::Logger::error("Unable to init Borealis application");
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2021-03-14 15:24:56 +00:00
|
|
|
|
|
|
|
nlohmann::json languageFile = parseJsonFile(LANGUAGE_JSON);
|
|
|
|
if(languageFile.find("language") != languageFile.end())
|
|
|
|
i18n::loadTranslations(languageFile["language"]);
|
|
|
|
else
|
|
|
|
i18n::loadTranslations();
|
|
|
|
|
2020-10-05 23:53:12 +01:00
|
|
|
|
2020-09-20 01:21:28 +01:00
|
|
|
// Setup verbose logging on PC
|
|
|
|
#ifndef __SWITCH__
|
|
|
|
brls::Logger::setLogLevel(brls::LogLevel::DEBUG);
|
|
|
|
#endif
|
|
|
|
|
2020-10-05 01:59:46 +01:00
|
|
|
setsysInitialize();
|
|
|
|
plInitialize(PlServiceType_User);
|
2020-09-20 01:21:28 +01:00
|
|
|
nsInitialize();
|
|
|
|
socketInitializeDefault();
|
|
|
|
nxlinkStdio();
|
2020-09-20 21:58:40 +01:00
|
|
|
splInitialize();
|
2020-10-07 01:08:39 +01:00
|
|
|
romfsInit();
|
2021-03-10 20:43:00 +00:00
|
|
|
|
2020-09-20 01:21:28 +01:00
|
|
|
createTree(CONFIG_PATH);
|
|
|
|
|
|
|
|
brls::Logger::setLogLevel(brls::LogLevel::DEBUG);
|
|
|
|
brls::Logger::debug("Start");
|
|
|
|
|
2021-02-16 00:46:39 +00:00
|
|
|
if(std::filesystem::exists(HIDDEN_AIO_FILE)) {
|
|
|
|
brls::Application::pushView(new MainFrame());
|
|
|
|
}
|
|
|
|
else {
|
2021-03-01 18:19:17 +00:00
|
|
|
brls::Application::pushView(new WarningPage("menus/main/launch_warning"_i18n));
|
2021-02-16 00:46:39 +00:00
|
|
|
}
|
2020-09-20 01:21:28 +01:00
|
|
|
|
|
|
|
while (brls::Application::mainLoop());
|
|
|
|
|
2020-10-09 21:27:18 +01:00
|
|
|
romfsExit();
|
2020-09-20 01:21:28 +01:00
|
|
|
splExit();
|
|
|
|
socketExit();
|
|
|
|
nsExit();
|
2020-10-05 01:59:46 +01:00
|
|
|
setsysExit();
|
|
|
|
plExit();
|
2020-09-20 01:21:28 +01:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|