diff --git a/src/core/hle/libraries/libc/libc_stdio.cpp b/src/core/hle/libraries/libc/libc_stdio.cpp index f552f245d..89275020a 100644 --- a/src/core/hle/libraries/libc/libc_stdio.cpp +++ b/src/core/hle/libraries/libc/libc_stdio.cpp @@ -40,7 +40,7 @@ int PS4_SYSV_ABI vsnprintf(char* s, size_t n, const char* format, VaList* arg) { int PS4_SYSV_ABI puts(const char* s) { return std::puts(s); } FILE* PS4_SYSV_ABI fopen(const char* filename, const char* mode) { - LOG_ERROR_IF(log_file_libc, "fopen filename={} , mode ={}\n", filename, mode); + LOG_INFO_IF(log_file_libc, "fopen filename={} , mode ={}\n", filename, mode); auto* h = Common::Singleton::Instance(); auto* mnt = Common::Singleton::Instance(); @@ -49,10 +49,13 @@ FILE* PS4_SYSV_ABI fopen(const char* filename, const char* mode) { file->m_guest_name = filename; file->m_host_name = mnt->getHostFile(file->m_guest_name); FILE* f = std::fopen(file->m_host_name.c_str(), mode); + if (!f) { + LOG_ERROR_IF(log_file_libc, "fopen can't open file={}\n", filename); + } return f; } int PS4_SYSV_ABI fclose(FILE* stream) { - LOG_ERROR_IF(log_file_libc, "fclose\n"); + LOG_INFO_IF(log_file_libc, "fclose\n"); if (stream != nullptr) { std::fclose(stream); } diff --git a/src/main.cpp b/src/main.cpp index d9d56865b..b7723ae74 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,7 @@ #include "emuTimer.h" #include "emulator.h" #include +#include "core/file_sys/fs.h" int main(int argc, char* argv[]) { if (argc == 1) { @@ -35,6 +36,10 @@ int main(int argc, char* argv[]) { // Argument 1 is the path of self file to boot const char* const path = argv[1]; + auto* mnt = Common::Singleton::Instance(); + std::filesystem::path p = std::string(path); + mnt->mount(p.parent_path().string(), "/app0"); + auto linker = Common::Singleton::Instance(); Core::Libraries::InitHLELibs(&linker->getHLESymbols()); linker->LoadModule(path);