diff --git a/documents/Quickstart/Quickstart.md b/documents/Quickstart/Quickstart.md index 7e496bcce..58549e067 100644 --- a/documents/Quickstart/Quickstart.md +++ b/documents/Quickstart/Quickstart.md @@ -22,6 +22,7 @@ SPDX-License-Identifier: GPL-2.0-or-later - A processor with at least 4 cores and 6 threads - Above 2.5 GHz frequency +- required support AVX2 extension or Rosetta 2 on ARM ### GPU diff --git a/src/common/config.cpp b/src/common/config.cpp index 78da372e7..17862e6aa 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -538,12 +538,12 @@ void load(const std::filesystem::path& path) { // TODO Migration code, after a major release this should be removed. auto old_game_install_dir = toml::find_fs_path_or(gui, "installDir", {}); if (!old_game_install_dir.empty()) { - settings_install_dirs.emplace_back(std::filesystem::path{old_game_install_dir}); + addGameInstallDir(std::filesystem::path{old_game_install_dir}); } else { const auto install_dir_array = toml::find_or>(gui, "installDirs", {}); for (const auto& dir : install_dir_array) { - settings_install_dirs.emplace_back(std::filesystem::path{dir}); + addGameInstallDir(std::filesystem::path{dir}); } } diff --git a/src/core/address_space.cpp b/src/core/address_space.cpp index b2cb95a54..8ba99e32d 100644 --- a/src/core/address_space.cpp +++ b/src/core/address_space.cpp @@ -30,14 +30,13 @@ static constexpr size_t BackingSize = SCE_KERNEL_MAIN_DMEM_SIZE_PRO; #ifdef _WIN32 [[nodiscard]] constexpr u64 ToWindowsProt(Core::MemoryProt prot) { - switch (prot) { - case Core::MemoryProt::NoAccess: - default: - return PAGE_NOACCESS; - case Core::MemoryProt::CpuRead: - return PAGE_READONLY; - case Core::MemoryProt::CpuReadWrite: + if (True(prot & Core::MemoryProt::CpuReadWrite) || + True(prot & Core::MemoryProt::GpuReadWrite)) { return PAGE_READWRITE; + } else if (True(prot & Core::MemoryProt::CpuRead) || True(prot & Core::MemoryProt::GpuRead)) { + return PAGE_READONLY; + } else { + return PAGE_NOACCESS; } } @@ -290,14 +289,13 @@ enum PosixPageProtection { }; [[nodiscard]] constexpr PosixPageProtection ToPosixProt(Core::MemoryProt prot) { - switch (prot) { - case Core::MemoryProt::NoAccess: - default: - return PAGE_NOACCESS; - case Core::MemoryProt::CpuRead: - return PAGE_READONLY; - case Core::MemoryProt::CpuReadWrite: + if (True(prot & Core::MemoryProt::CpuReadWrite) || + True(prot & Core::MemoryProt::GpuReadWrite)) { return PAGE_READWRITE; + } else if (True(prot & Core::MemoryProt::CpuRead) || True(prot & Core::MemoryProt::GpuRead)) { + return PAGE_READONLY; + } else { + return PAGE_NOACCESS; } } diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index e2093ce21..7f86ee540 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -321,26 +321,26 @@ int PS4_SYSV_ABI sceKernelRmdir(const char* path) { const std::filesystem::path dir_name = mnt->GetHostPath(path, &ro); if (dir_name.empty()) { - LOG_INFO(Kernel_Fs, "Failed to remove directory: {}, permission denied", - fmt::UTF(dir_name.u8string())); + LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, permission denied", + fmt::UTF(dir_name.u8string())); return SCE_KERNEL_ERROR_EACCES; } if (ro) { - LOG_INFO(Kernel_Fs, "Failed to remove directory: {}, directory is read only", - fmt::UTF(dir_name.u8string())); + LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, directory is read only", + fmt::UTF(dir_name.u8string())); return SCE_KERNEL_ERROR_EROFS; } if (!std::filesystem::is_directory(dir_name)) { - LOG_INFO(Kernel_Fs, "Failed to remove directory: {}, path is not a directory", - fmt::UTF(dir_name.u8string())); + LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, path is not a directory", + fmt::UTF(dir_name.u8string())); return ORBIS_KERNEL_ERROR_ENOTDIR; } if (!std::filesystem::exists(dir_name)) { - LOG_INFO(Kernel_Fs, "Failed to remove directory: {}, no such file or directory", - fmt::UTF(dir_name.u8string())); + LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, no such file or directory", + fmt::UTF(dir_name.u8string())); return ORBIS_KERNEL_ERROR_ENOENT; } @@ -348,7 +348,7 @@ int PS4_SYSV_ABI sceKernelRmdir(const char* path) { int result = std::filesystem::remove_all(dir_name, ec); if (!ec) { - LOG_DEBUG(Kernel_Fs, "Removed directory: {}", fmt::UTF(dir_name.u8string())); + LOG_INFO(Kernel_Fs, "Removed directory: {}", fmt::UTF(dir_name.u8string())); return ORBIS_OK; } LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, error_code={}", diff --git a/src/core/libraries/kernel/libkernel.cpp b/src/core/libraries/kernel/libkernel.cpp index 72f8f1d1d..b013f29bf 100644 --- a/src/core/libraries/kernel/libkernel.cpp +++ b/src/core/libraries/kernel/libkernel.cpp @@ -157,6 +157,7 @@ void SetPosixErrno(int e) { g_posix_errno = e; } } + int PS4_SYSV_ABI sceKernelMmap(void* addr, u64 len, int prot, int flags, int fd, size_t offset, void** res) { LOG_INFO(Kernel_Vmm, "called addr = {}, len = {}, prot = {}, flags = {}, fd = {}, offset = {}", diff --git a/src/core/memory.h b/src/core/memory.h index 752209cfc..320aa367a 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -28,7 +28,7 @@ enum class MemoryProt : u32 { CpuReadWrite = 2, GpuRead = 16, GpuWrite = 32, - GpuReadWrite = 38, + GpuReadWrite = 48, }; DECLARE_ENUM_FLAG_OPERATORS(MemoryProt)