MCPcopy Create free account
hub / github.com/XorTroll/uLaunch / main

Function main

projects/uMenu/source/main.cpp:295–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293// uMenu procedure: read sent storages, initialize RomFs (externally), load config and other stuff, finally create the renderer and start the UI
294
295int main() {
296 InitializeSettings();
297
298 UL_RC_ASSERT(ul::menu::am::ReadStartMode(g_StartMode));
299 UL_ASSERT_TRUE(g_StartMode != ul::smi::MenuStartMode::Invalid);
300
301 // Information sent as an extra storage to uMenu
302 UL_RC_ASSERT(ul::menu::am::ReadFromInputStorage(&g_GlobalSettings.system_status, sizeof(g_GlobalSettings.system_status)));
303 g_GlobalSettings.initial_last_menu_index = g_GlobalSettings.system_status.last_menu_index;
304 g_GlobalSettings.initial_last_menu_fs_path = g_GlobalSettings.system_status.last_menu_fs_path;
305 UL_LOG_INFO("Start mode: %d, last path: '%s', last fs path: '%s', last menu index: %d", (u32)g_StartMode, g_GlobalSettings.system_status.last_menu_path, g_GlobalSettings.system_status.last_menu_fs_path, g_GlobalSettings.system_status.last_menu_index);
306
307 // Check if our RomFs data exists...
308 if(!ul::fs::ExistsFile(ul::MenuRomfsFile)) {
309 UL_RC_ASSERT(ul::ResultRomfsNotFound);
310 }
311
312 // Try to mount it
313 UL_RC_ASSERT(romfsMountFromFsdev(ul::MenuRomfsFile, 0, "romfs"));
314
315 // Register handlers for HOME button press detection
316 ul::menu::am::RegisterLibnxLibappletHomeButtonDetection();
317 ul::menu::ui::QuickMenu::RegisterHomeButtonDetection();
318
319 MainLoop();
320
321 return 0;
322}

Callers

nothing calls this directly

Calls 6

InitializeSettingsFunction · 0.85
ReadStartModeFunction · 0.85
ReadFromInputStorageFunction · 0.85
ExistsFileFunction · 0.85
MainLoopFunction · 0.70

Tested by

no test coverage detected