1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-11-28 20:32:06 +00:00
AIO-switch-updater/source/main.cpp

71 lines
1.5 KiB
C++
Raw Normal View History

//#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"
#include "current_cfw.hpp"
#include "warning_page.hpp"
#include <filesystem>
namespace i18n = brls::i18n;
using namespace i18n::literals;
//TimeServiceType __nx_time_service_type = TimeServiceType_System;
2021-02-12 22:20:16 +00:00
const CFW running_cfw = getCFW();
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;
}
i18n::loadTranslations();
2020-09-20 01:21:28 +01:00
// Setup verbose logging on PC
#ifndef __SWITCH__
brls::Logger::setLogLevel(brls::LogLevel::DEBUG);
#endif
// Initialize services with a PC shim
setsysInitialize();
plInitialize(PlServiceType_User);
2020-09-20 01:21:28 +01:00
nsInitialize();
socketInitializeDefault();
nxlinkStdio();
splInitialize();
2020-10-07 01:08:39 +01:00
romfsInit();
2020-09-20 01:21:28 +01:00
createTree(CONFIG_PATH);
brls::Logger::setLogLevel(brls::LogLevel::DEBUG);
brls::Logger::debug("Start");
if(std::filesystem::exists(HIDDEN_AIO_FILE)) {
brls::Application::pushView(new MainFrame());
}
else {
brls::Application::pushView(new WarningPage("menus/launch_warning"_i18n));
}
2020-09-20 01:21:28 +01:00
// Run the app
while (brls::Application::mainLoop());
// Exit
romfsExit();
2020-09-20 01:21:28 +01:00
splExit();
socketExit();
nsExit();
setsysExit();
plExit();
2020-09-20 01:21:28 +01:00
return EXIT_SUCCESS;
}