mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
some more fopen debugging
This commit is contained in:
parent
57985304c6
commit
7feffecb0f
@ -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); }
|
int PS4_SYSV_ABI puts(const char* s) { return std::puts(s); }
|
||||||
|
|
||||||
FILE* PS4_SYSV_ABI fopen(const char* filename, const char* mode) {
|
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<Core::FileSys::HandleTable>::Instance();
|
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
|
||||||
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
||||||
|
|
||||||
@ -49,10 +49,13 @@ FILE* PS4_SYSV_ABI fopen(const char* filename, const char* mode) {
|
|||||||
file->m_guest_name = filename;
|
file->m_guest_name = filename;
|
||||||
file->m_host_name = mnt->getHostFile(file->m_guest_name);
|
file->m_host_name = mnt->getHostFile(file->m_guest_name);
|
||||||
FILE* f = std::fopen(file->m_host_name.c_str(), mode);
|
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;
|
return f;
|
||||||
}
|
}
|
||||||
int PS4_SYSV_ABI fclose(FILE* stream) {
|
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) {
|
if (stream != nullptr) {
|
||||||
std::fclose(stream);
|
std::fclose(stream);
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "emuTimer.h"
|
#include "emuTimer.h"
|
||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
#include <core/hle/libraries/libkernel/thread_management.h>
|
#include <core/hle/libraries/libkernel/thread_management.h>
|
||||||
|
#include "core/file_sys/fs.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
@ -35,6 +36,10 @@ int main(int argc, char* argv[]) {
|
|||||||
// Argument 1 is the path of self file to boot
|
// Argument 1 is the path of self file to boot
|
||||||
const char* const path = argv[1];
|
const char* const path = argv[1];
|
||||||
|
|
||||||
|
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
||||||
|
std::filesystem::path p = std::string(path);
|
||||||
|
mnt->mount(p.parent_path().string(), "/app0");
|
||||||
|
|
||||||
auto linker = Common::Singleton<Core::Linker>::Instance();
|
auto linker = Common::Singleton<Core::Linker>::Instance();
|
||||||
Core::Libraries::InitHLELibs(&linker->getHLESymbols());
|
Core::Libraries::InitHLELibs(&linker->getHLESymbols());
|
||||||
linker->LoadModule(path);
|
linker->LoadModule(path);
|
||||||
|
Loading…
Reference in New Issue
Block a user