mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
Merge branch 'shadps4-emu:main' into main
This commit is contained in:
commit
31caf01366
@ -22,6 +22,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
|||||||
|
|
||||||
- A processor with at least 4 cores and 6 threads
|
- A processor with at least 4 cores and 6 threads
|
||||||
- Above 2.5 GHz frequency
|
- Above 2.5 GHz frequency
|
||||||
|
- required support AVX2 extension or Rosetta 2 on ARM
|
||||||
|
|
||||||
### GPU
|
### GPU
|
||||||
|
|
||||||
|
@ -538,12 +538,12 @@ void load(const std::filesystem::path& path) {
|
|||||||
// TODO Migration code, after a major release this should be removed.
|
// TODO Migration code, after a major release this should be removed.
|
||||||
auto old_game_install_dir = toml::find_fs_path_or(gui, "installDir", {});
|
auto old_game_install_dir = toml::find_fs_path_or(gui, "installDir", {});
|
||||||
if (!old_game_install_dir.empty()) {
|
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 {
|
} else {
|
||||||
const auto install_dir_array =
|
const auto install_dir_array =
|
||||||
toml::find_or<std::vector<std::string>>(gui, "installDirs", {});
|
toml::find_or<std::vector<std::string>>(gui, "installDirs", {});
|
||||||
for (const auto& dir : install_dir_array) {
|
for (const auto& dir : install_dir_array) {
|
||||||
settings_install_dirs.emplace_back(std::filesystem::path{dir});
|
addGameInstallDir(std::filesystem::path{dir});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,14 +30,13 @@ static constexpr size_t BackingSize = SCE_KERNEL_MAIN_DMEM_SIZE_PRO;
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
[[nodiscard]] constexpr u64 ToWindowsProt(Core::MemoryProt prot) {
|
[[nodiscard]] constexpr u64 ToWindowsProt(Core::MemoryProt prot) {
|
||||||
switch (prot) {
|
if (True(prot & Core::MemoryProt::CpuReadWrite) ||
|
||||||
case Core::MemoryProt::NoAccess:
|
True(prot & Core::MemoryProt::GpuReadWrite)) {
|
||||||
default:
|
|
||||||
return PAGE_NOACCESS;
|
|
||||||
case Core::MemoryProt::CpuRead:
|
|
||||||
return PAGE_READONLY;
|
|
||||||
case Core::MemoryProt::CpuReadWrite:
|
|
||||||
return PAGE_READWRITE;
|
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) {
|
[[nodiscard]] constexpr PosixPageProtection ToPosixProt(Core::MemoryProt prot) {
|
||||||
switch (prot) {
|
if (True(prot & Core::MemoryProt::CpuReadWrite) ||
|
||||||
case Core::MemoryProt::NoAccess:
|
True(prot & Core::MemoryProt::GpuReadWrite)) {
|
||||||
default:
|
|
||||||
return PAGE_NOACCESS;
|
|
||||||
case Core::MemoryProt::CpuRead:
|
|
||||||
return PAGE_READONLY;
|
|
||||||
case Core::MemoryProt::CpuReadWrite:
|
|
||||||
return PAGE_READWRITE;
|
return PAGE_READWRITE;
|
||||||
|
} else if (True(prot & Core::MemoryProt::CpuRead) || True(prot & Core::MemoryProt::GpuRead)) {
|
||||||
|
return PAGE_READONLY;
|
||||||
|
} else {
|
||||||
|
return PAGE_NOACCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,26 +321,26 @@ int PS4_SYSV_ABI sceKernelRmdir(const char* path) {
|
|||||||
const std::filesystem::path dir_name = mnt->GetHostPath(path, &ro);
|
const std::filesystem::path dir_name = mnt->GetHostPath(path, &ro);
|
||||||
|
|
||||||
if (dir_name.empty()) {
|
if (dir_name.empty()) {
|
||||||
LOG_INFO(Kernel_Fs, "Failed to remove directory: {}, permission denied",
|
LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, permission denied",
|
||||||
fmt::UTF(dir_name.u8string()));
|
fmt::UTF(dir_name.u8string()));
|
||||||
return SCE_KERNEL_ERROR_EACCES;
|
return SCE_KERNEL_ERROR_EACCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ro) {
|
if (ro) {
|
||||||
LOG_INFO(Kernel_Fs, "Failed to remove directory: {}, directory is read only",
|
LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, directory is read only",
|
||||||
fmt::UTF(dir_name.u8string()));
|
fmt::UTF(dir_name.u8string()));
|
||||||
return SCE_KERNEL_ERROR_EROFS;
|
return SCE_KERNEL_ERROR_EROFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!std::filesystem::is_directory(dir_name)) {
|
if (!std::filesystem::is_directory(dir_name)) {
|
||||||
LOG_INFO(Kernel_Fs, "Failed to remove directory: {}, path is not a directory",
|
LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, path is not a directory",
|
||||||
fmt::UTF(dir_name.u8string()));
|
fmt::UTF(dir_name.u8string()));
|
||||||
return ORBIS_KERNEL_ERROR_ENOTDIR;
|
return ORBIS_KERNEL_ERROR_ENOTDIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!std::filesystem::exists(dir_name)) {
|
if (!std::filesystem::exists(dir_name)) {
|
||||||
LOG_INFO(Kernel_Fs, "Failed to remove directory: {}, no such file or directory",
|
LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, no such file or directory",
|
||||||
fmt::UTF(dir_name.u8string()));
|
fmt::UTF(dir_name.u8string()));
|
||||||
return ORBIS_KERNEL_ERROR_ENOENT;
|
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);
|
int result = std::filesystem::remove_all(dir_name, ec);
|
||||||
|
|
||||||
if (!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;
|
return ORBIS_OK;
|
||||||
}
|
}
|
||||||
LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, error_code={}",
|
LOG_ERROR(Kernel_Fs, "Failed to remove directory: {}, error_code={}",
|
||||||
|
@ -157,6 +157,7 @@ void SetPosixErrno(int e) {
|
|||||||
g_posix_errno = e;
|
g_posix_errno = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI sceKernelMmap(void* addr, u64 len, int prot, int flags, int fd, size_t offset,
|
int PS4_SYSV_ABI sceKernelMmap(void* addr, u64 len, int prot, int flags, int fd, size_t offset,
|
||||||
void** res) {
|
void** res) {
|
||||||
LOG_INFO(Kernel_Vmm, "called addr = {}, len = {}, prot = {}, flags = {}, fd = {}, offset = {}",
|
LOG_INFO(Kernel_Vmm, "called addr = {}, len = {}, prot = {}, flags = {}, fd = {}, offset = {}",
|
||||||
|
@ -28,7 +28,7 @@ enum class MemoryProt : u32 {
|
|||||||
CpuReadWrite = 2,
|
CpuReadWrite = 2,
|
||||||
GpuRead = 16,
|
GpuRead = 16,
|
||||||
GpuWrite = 32,
|
GpuWrite = 32,
|
||||||
GpuReadWrite = 38,
|
GpuReadWrite = 48,
|
||||||
};
|
};
|
||||||
DECLARE_ENUM_FLAG_OPERATORS(MemoryProt)
|
DECLARE_ENUM_FLAG_OPERATORS(MemoryProt)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user