From 51260ca6ce1719c0f88a58b55d28a99af73a3757 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Fri, 20 Oct 2023 09:09:59 +0300 Subject: [PATCH] mount host_folder to guest_folder --- src/Emulator/Host/fs.cpp | 10 +++++++++- src/Emulator/Host/fs.h | 2 +- src/main.cpp | 10 +++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/Emulator/Host/fs.cpp b/src/Emulator/Host/fs.cpp index 554abca4..38bce9db 100644 --- a/src/Emulator/Host/fs.cpp +++ b/src/Emulator/Host/fs.cpp @@ -1,7 +1,15 @@ #include "fs.h" namespace Emulator::Host::Fs { -void MntPoints::mount(const std::string& host_folder, const std::string& quest_folder) {} +void MntPoints::mount(const std::string& host_folder, const std::string& guest_folder) { + Lib::LockMutexGuard lock(m_mutex); + + MntPair pair; + pair.host_path = host_folder; + pair.guest_path = guest_folder; + + m_mnt_pairs.push_back(pair); +} void MntPoints::unMount(const std::string& path) {} void MntPoints::unMountAll() {} } // namespace Emulator::Host::Fs \ No newline at end of file diff --git a/src/Emulator/Host/fs.h b/src/Emulator/Host/fs.h index e35266da..45071f47 100644 --- a/src/Emulator/Host/fs.h +++ b/src/Emulator/Host/fs.h @@ -21,7 +21,7 @@ class MntPoints { MntPoints() {} virtual ~MntPoints() {} - void mount(const std::string& host_folder, const std::string& quest_folder); + void mount(const std::string& host_folder, const std::string& guest_folder); void unMount(const std::string& path); void unMountAll(); diff --git a/src/main.cpp b/src/main.cpp index fa9b7bee..ba2bd0cc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,7 @@ #include #include - +#include #include "imgui.h" #include "imgui_impl_opengl3.h" #include "imgui_impl_sdl3.h" @@ -35,7 +35,8 @@ #include "Core/PS4/HLE/Libs.h" #include "Core/PS4/Linker.h" #include "Lib/Threads.h" -#include "Emulator/Util\singleton.h" +#include "Emulator\Util\singleton.h" +#include "Emulator\Host\fs.h" #include "discord.h" // Main code @@ -51,9 +52,12 @@ int main(int argc, char* argv[]) { Emu::emuInit(width, height); HLE::Libs::Graphics::VideoOut::videoOutInit(width, height); Lib::InitThreads(); - const char* const path = argv[1]; // argument 1 is the path of self file to boot + auto* mnt = singleton::instance(); + std::filesystem::path p = std::string(path); + mnt->mount(p.parent_path().string(), "/app0"); + auto* linker = singleton::instance(); HLE::Libs::Init_HLE_Libs(linker->getHLESymbols()); auto* module = linker->LoadModule(path); // load main executable