MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / Init

Method Init

rpcs3/Emu/System.cpp:414–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414void Emulator::Init()
415{
416 // Log LLVM version
417 if (static bool logged_llvm = false; !logged_llvm)
418 {
419#ifndef LLVM_AVAILABLE
420 sys_log.always()("LLVM version: Compiled without LLVM");
421#elif defined(LLVM_VERSION_STRING)
422 sys_log.always()("LLVM version: %s", LLVM_VERSION_STRING);
423#else
424 sys_log.always()("LLVM version: Unknown");
425#endif
426 logged_llvm = true;
427 }
428
429 jit_runtime::initialize();
430
431 const std::string emu_dir = rpcs3::utils::get_emu_dir();
432 auto make_path_verbose = [&](const std::string& path, bool must_exist_outside_emu_dir)
433 {
434 if (fs::is_dir(path))
435 {
436 return true;
437 }
438
439 if (must_exist_outside_emu_dir)
440 {
441 const std::string parent = fs::get_parent_dir(path);
442 const std::string emu_dir_no_delim = emu_dir.substr(0, emu_dir.find_last_not_of(fs::delim) + 1);
443
444 if (parent != emu_dir_no_delim && GetCallbacks().resolve_path(parent) != GetCallbacks().resolve_path(emu_dir_no_delim))
445 {
446 sys_log.fatal("Cannot use '%s' for Virtual File System because it does not exist.\nPlease specify an existing and writable directory path in Toolbar -> Manage -> Virtual File System.", path);
447 return false;
448 }
449 }
450
451 if (!fs::create_path(path))
452 {
453 sys_log.fatal("Failed to create path: %s (%s)", path, fs::g_tls_error);
454 return false;
455 }
456
457 return true;
458 };
459
460 if (!g_tty)
461 {
462 make_path_verbose(fs::get_log_dir(), true);
463
464 const auto tty_path = fs::get_log_dir() + "TTY.log";
465 g_tty.open(tty_path, fs::rewrite + fs::append);
466
467 if (!g_tty)
468 {
469 sys_log.fatal("Failed to create TTY log: %s (%s)", tty_path, fs::g_tls_error);
470 }
471 }

Callers 8

cellMouseInitFunction · 0.45
reset_controllerMethod · 0.45
mouse_input_to_padFunction · 0.45
mouse_pos_to_gem_stateFunction · 0.45
initVirtualPadFunction · 0.45
_rpcsx_initializeFunction · 0.45
_rpcsx_usbDeviceEventFunction · 0.45
extract_tarFunction · 0.45

Calls 15

get_emu_dirFunction · 0.85
get_parent_dirFunction · 0.85
create_pathFunction · 0.85
renameFunction · 0.85
getFunction · 0.85
fixup_settingsFunction · 0.85
write_fileFunction · 0.85
get_cache_dirFunction · 0.85
get_savestate_fileFunction · 0.85
dirClass · 0.85
limit_cache_sizeFunction · 0.85
substrMethod · 0.80

Tested by

no test coverage detected