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

Method impl

android/src/rpcsx-android.cpp:1316–1425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1314
1315private:
1316 void impl(JNIEnv *env, CompilationWorkload workload) {
1317 if (workload.path.empty()) {
1318 Progress(env, workload.progressId).success(0);
1319 return;
1320 }
1321
1322 rpcsx_android.error("Creating cache initiated, state %d",
1323 (int)Emu.GetStatus(false));
1324
1325 while (true) {
1326 auto state = Emu.GetStatus(false);
1327
1328 if (state == system_state::stopped || state == system_state::ready) {
1329 break;
1330 }
1331
1332 rpcsx_android.error("Creating cache wait, state %d", (int)state);
1333 std::this_thread::sleep_for(std::chrono::seconds(1));
1334 }
1335
1336 bool is_vsh = workload.path.ends_with("/vsh.self");
1337
1338 Emu.SetState(system_state::running);
1339
1340 MessageDialog::pushPendingProgressId(workload.progressId);
1341
1342 g_fxo->init<named_thread<progress_dialog_server>>();
1343 g_fxo->init<main_ppu_module<lv2_obj>>();
1344 g_fxo->init(false, nullptr);
1345 auto rootPath = std::filesystem::path(workload.path);
1346
1347 if (is_vsh) {
1348 rootPath = g_cfg_vfs.get_dev_flash() + "sys/external/";
1349 } else {
1350 if (!std::filesystem::is_directory(rootPath)) {
1351 rootPath = rootPath.parent_path();
1352 if (rootPath.filename() == "USRDIR") {
1353 rootPath = rootPath.parent_path();
1354 }
1355 }
1356 }
1357
1358 auto &_main = *ensure(g_fxo->try_get<main_ppu_module<lv2_obj>>());
1359
1360 if (fs::is_file(workload.path)) {
1361 if (!is_vsh) {
1362 auto sfoPath = locateParamSfoPath(std::string(rootPath));
1363
1364 if (!sfoPath.empty()) {
1365 const auto psf = psf::load_object(sfoPath);
1366 rpcsx_android.warning("title id is %s",
1367 psf::get_string(psf, "TITLE_ID"));
1368
1369 Emu.SetTitleID(std::string(psf::get_string(psf, "TITLE_ID")));
1370 } else {
1371 rpcsx_android.warning("param.sfo not found");
1372 }
1373 }

Callers

nothing calls this directly

Calls 15

ProgressClass · 0.85
locateParamSfoPathFunction · 0.85
load_objectFunction · 0.85
get_stringFunction · 0.85
decrypt_selfFunction · 0.85
ppu_load_execFunction · 0.85
ppu_initializeFunction · 0.85
ppu_precompileFunction · 0.85
successMethod · 0.80
errorMethod · 0.80
GetStatusMethod · 0.80
SetStateMethod · 0.80

Tested by

no test coverage detected