mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
Merge pull request #281 from shadps4-emu/miscFixes6
Misc Fixes (forgot the number)
This commit is contained in:
2
externals/fmt
vendored
2
externals/fmt
vendored
Submodule externals/fmt updated: a96259701e...bc8d32e964
2
externals/glslang
vendored
2
externals/glslang
vendored
Submodule externals/glslang updated: 5939e32b87...52f68dc6b2
2
externals/magic_enum
vendored
2
externals/magic_enum
vendored
Submodule externals/magic_enum updated: ec1adc5763...664ee62c12
2
externals/vma
vendored
2
externals/vma
vendored
Submodule externals/vma updated: 257138b8f5...871913da6a
2
externals/vulkan-headers
vendored
2
externals/vulkan-headers
vendored
Submodule externals/vulkan-headers updated: 190d2cb24e...b379292b2a
2
externals/winpthreads
vendored
2
externals/winpthreads
vendored
Submodule externals/winpthreads updated: d937b60055...f00c973a6a
2
externals/xxhash
vendored
2
externals/xxhash
vendored
Submodule externals/xxhash updated: 805c00b68f...a57f6cce26
2
externals/zydis
vendored
2
externals/zydis
vendored
Submodule externals/zydis updated: 5a68f639e4...16c6a369c1
@@ -56,7 +56,6 @@ int PS4_SYSV_ABI sceImeDialogGetStatus() {
|
|||||||
if (g_ime_dlg_status == OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_RUNNING) {
|
if (g_ime_dlg_status == OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_RUNNING) {
|
||||||
return OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_FINISHED;
|
return OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return g_ime_dlg_status;
|
return g_ime_dlg_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -463,6 +463,7 @@ void fileSystemSymbolsRegister(Core::Loader::SymbolsResolver* sym) {
|
|||||||
LIB_FUNCTION("1G3lF1Gg1k8", "libkernel", 1, "libkernel", 1, 1, sceKernelOpen);
|
LIB_FUNCTION("1G3lF1Gg1k8", "libkernel", 1, "libkernel", 1, 1, sceKernelOpen);
|
||||||
LIB_FUNCTION("wuCroIGjt2g", "libScePosix", 1, "libkernel", 1, 1, posix_open);
|
LIB_FUNCTION("wuCroIGjt2g", "libScePosix", 1, "libkernel", 1, 1, posix_open);
|
||||||
LIB_FUNCTION("UK2Tl2DWUns", "libkernel", 1, "libkernel", 1, 1, sceKernelClose);
|
LIB_FUNCTION("UK2Tl2DWUns", "libkernel", 1, "libkernel", 1, 1, sceKernelClose);
|
||||||
|
LIB_FUNCTION("bY-PO6JhzhQ", "libkernel", 1, "libkernel", 1, 1, posix_close);
|
||||||
LIB_FUNCTION("bY-PO6JhzhQ", "libScePosix", 1, "libkernel", 1, 1, posix_close);
|
LIB_FUNCTION("bY-PO6JhzhQ", "libScePosix", 1, "libkernel", 1, 1, posix_close);
|
||||||
LIB_FUNCTION("4wSze92BhLI", "libkernel", 1, "libkernel", 1, 1, sceKernelWrite);
|
LIB_FUNCTION("4wSze92BhLI", "libkernel", 1, "libkernel", 1, 1, sceKernelWrite);
|
||||||
|
|
||||||
|
|||||||
@@ -351,6 +351,10 @@ int PS4_SYSV_ABI _sigprocmask() {
|
|||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int PS4_SYSV_ABI posix_getpagesize() {
|
||||||
|
return 4096;
|
||||||
|
}
|
||||||
|
|
||||||
void LibKernel_Register(Core::Loader::SymbolsResolver* sym) {
|
void LibKernel_Register(Core::Loader::SymbolsResolver* sym) {
|
||||||
service_thread = std::jthread{KernelServiceThread};
|
service_thread = std::jthread{KernelServiceThread};
|
||||||
|
|
||||||
@@ -414,6 +418,7 @@ void LibKernel_Register(Core::Loader::SymbolsResolver* sym) {
|
|||||||
LIB_FUNCTION("-o5uEDpN+oY", "libkernel", 1, "libkernel", 1, 1, sceKernelConvertUtcToLocaltime);
|
LIB_FUNCTION("-o5uEDpN+oY", "libkernel", 1, "libkernel", 1, 1, sceKernelConvertUtcToLocaltime);
|
||||||
LIB_FUNCTION("WB66evu8bsU", "libkernel", 1, "libkernel", 1, 1, sceKernelGetCompiledSdkVersion);
|
LIB_FUNCTION("WB66evu8bsU", "libkernel", 1, "libkernel", 1, 1, sceKernelGetCompiledSdkVersion);
|
||||||
LIB_FUNCTION("DRuBt2pvICk", "libkernel", 1, "libkernel", 1, 1, ps4__read);
|
LIB_FUNCTION("DRuBt2pvICk", "libkernel", 1, "libkernel", 1, 1, ps4__read);
|
||||||
|
LIB_FUNCTION("k+AXqu2-eBc", "libScePosix", 1, "libkernel", 1, 1, posix_getpagesize);
|
||||||
|
|
||||||
Libraries::Kernel::fileSystemSymbolsRegister(sym);
|
Libraries::Kernel::fileSystemSymbolsRegister(sym);
|
||||||
Libraries::Kernel::timeSymbolsRegister(sym);
|
Libraries::Kernel::timeSymbolsRegister(sym);
|
||||||
|
|||||||
@@ -1329,6 +1329,26 @@ int PS4_SYSV_ABI scePthreadSetprio(ScePthread thread, int prio) {
|
|||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int PS4_SYSV_ABI posix_pthread_condattr_init(ScePthreadCondattr* attr) {
|
||||||
|
int result = scePthreadCondattrInit(attr);
|
||||||
|
LOG_INFO(Kernel_Pthread,
|
||||||
|
"posix_pthread_condattr_init redirect to scePthreadCondattrInit, result = {}", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
int PS4_SYSV_ABI posix_pthread_condattr_destroy(ScePthreadCondattr* attr) {
|
||||||
|
int result = scePthreadCondattrDestroy(attr);
|
||||||
|
LOG_INFO(Kernel_Pthread,
|
||||||
|
"posix_pthread_condattr_destroy redirect to scePthreadCondattrDestroy, result = {}",
|
||||||
|
result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
int PS4_SYSV_ABI posix_pthread_condattr_setclock(ScePthreadCondattr* attr, clockid_t clock) {
|
||||||
|
(*attr)->clock = clock;
|
||||||
|
return SCE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) {
|
void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) {
|
||||||
LIB_FUNCTION("lZzFeSxPl08", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_setcancelstate);
|
LIB_FUNCTION("lZzFeSxPl08", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_setcancelstate);
|
||||||
LIB_FUNCTION("0TyVk4MSLt0", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_cond_init);
|
LIB_FUNCTION("0TyVk4MSLt0", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_cond_init);
|
||||||
@@ -1416,6 +1436,11 @@ void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) {
|
|||||||
posix_pthread_mutexattr_setprotocol);
|
posix_pthread_mutexattr_setprotocol);
|
||||||
LIB_FUNCTION("HF7lK46xzjY", "libScePosix", 1, "libkernel", 1, 1,
|
LIB_FUNCTION("HF7lK46xzjY", "libScePosix", 1, "libkernel", 1, 1,
|
||||||
posix_pthread_mutexattr_destroy);
|
posix_pthread_mutexattr_destroy);
|
||||||
|
LIB_FUNCTION("mKoTx03HRWA", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_condattr_init);
|
||||||
|
LIB_FUNCTION("dJcuQVn6-Iw", "libScePosix", 1, "libkernel", 1, 1,
|
||||||
|
posix_pthread_condattr_destroy);
|
||||||
|
LIB_FUNCTION("EjllaAqAPZo", "libScePosix", 1, "libkernel", 1, 1,
|
||||||
|
posix_pthread_condattr_setclock);
|
||||||
LIB_FUNCTION("Z4QosVuAsA0", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_once);
|
LIB_FUNCTION("Z4QosVuAsA0", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_once);
|
||||||
|
|
||||||
// openorbis weird functions
|
// openorbis weird functions
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ struct PthreadCondInternal {
|
|||||||
struct PthreadCondAttrInternal {
|
struct PthreadCondAttrInternal {
|
||||||
u8 reserved[64];
|
u8 reserved[64];
|
||||||
pthread_condattr_t cond_attr;
|
pthread_condattr_t cond_attr;
|
||||||
|
clockid_t clock;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PthreadRwLockAttrInternal {
|
struct PthreadRwLockAttrInternal {
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ int PS4_SYSV_ABI sceKernelClockGettime(s32 clock_id, OrbisKernelTimespec* tp) {
|
|||||||
pclock_id = CLOCK_MONOTONIC;
|
pclock_id = CLOCK_MONOTONIC;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
LOG_ERROR(Lib_Kernel, "unsupported = {} using CLOCK_REALTIME", clock_id);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
timespec t{};
|
timespec t{};
|
||||||
|
|||||||
@@ -178,12 +178,39 @@ int PS4_SYSV_ABI sceSaveDataDeleteUser() {
|
|||||||
|
|
||||||
int PS4_SYSV_ABI sceSaveDataDirNameSearch(const OrbisSaveDataDirNameSearchCond* cond,
|
int PS4_SYSV_ABI sceSaveDataDirNameSearch(const OrbisSaveDataDirNameSearchCond* cond,
|
||||||
OrbisSaveDataDirNameSearchResult* result) {
|
OrbisSaveDataDirNameSearchResult* result) {
|
||||||
if (cond == nullptr || cond->dirName == nullptr)
|
if (cond == nullptr)
|
||||||
return ORBIS_SAVE_DATA_ERROR_PARAMETER;
|
return ORBIS_SAVE_DATA_ERROR_PARAMETER;
|
||||||
LOG_ERROR(Lib_SaveData,
|
LOG_ERROR(Lib_SaveData, "TODO sceSaveDataDirNameSearch: Add params");
|
||||||
"TODO sceSaveDataDirNameSearch: search_dir_name = {}, key = {}, result = {}",
|
const auto& mount_dir = Common::FS::GetUserPath(Common::FS::PathType::SaveDataDir) /
|
||||||
cond->dirName->data, (int)cond->key, (result->infos == nullptr));
|
std::to_string(cond->userId) / game_serial;
|
||||||
|
if (!mount_dir.empty() && std::filesystem::exists(mount_dir)) {
|
||||||
|
if (cond->dirName == nullptr) { // look for all dirs if no dir is provided.
|
||||||
|
for (int i = 0; const auto& entry : std::filesystem::directory_iterator(mount_dir)) {
|
||||||
|
if (std::filesystem::is_directory(entry.path())) {
|
||||||
|
i++;
|
||||||
|
result->dirNamesNum = 0; // why is it 1024? is it max?
|
||||||
|
// copy dir name to be used by sceSaveDataMount in read mode.
|
||||||
|
strncpy(result->dirNames[i].data, entry.path().filename().string().c_str(), 32);
|
||||||
|
result->hitNum = i + 1;
|
||||||
|
result->dirNamesNum = i + 1; // to confirm
|
||||||
|
result->setNum = i + 1; // to confirm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { // Need a game to test.
|
||||||
|
strncpy(result->dirNames[0].data, cond->dirName->data, 32);
|
||||||
|
result->hitNum = 1;
|
||||||
|
result->dirNamesNum = 1; // to confirm
|
||||||
|
result->setNum = 1; // to confirm
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result->hitNum = 0;
|
||||||
|
result->dirNamesNum = 0;
|
||||||
|
result->setNum = 0;
|
||||||
|
}
|
||||||
|
if (result->infos != nullptr) {
|
||||||
|
result->infos->blocks = ORBIS_SAVE_DATA_BLOCK_SIZE;
|
||||||
|
result->infos->freeBlocks = ORBIS_SAVE_DATA_BLOCK_SIZE;
|
||||||
|
}
|
||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,15 +114,11 @@ void Emulator::Run(const std::filesystem::path& file) {
|
|||||||
std::filesystem::path sce_module_folder = file.parent_path() / "sce_module";
|
std::filesystem::path sce_module_folder = file.parent_path() / "sce_module";
|
||||||
if (std::filesystem::is_directory(sce_module_folder)) {
|
if (std::filesystem::is_directory(sce_module_folder)) {
|
||||||
for (const auto& entry : std::filesystem::directory_iterator(sce_module_folder)) {
|
for (const auto& entry : std::filesystem::directory_iterator(sce_module_folder)) {
|
||||||
if (entry.path().filename() == "libc.prx" ||
|
if (entry.path().filename() == "libc.prx") {
|
||||||
entry.path().filename() == "libSceFios2.prx" ||
|
|
||||||
entry.path().filename() == "libSceAudioLatencyEstimation.prx" ||
|
|
||||||
entry.path().filename() == "libSceJobManager.prx" ||
|
|
||||||
entry.path().filename() == "libSceS3DConversion.prx") {
|
|
||||||
found = true;
|
found = true;
|
||||||
LOG_INFO(Loader, "Loading {}", entry.path().string().c_str());
|
|
||||||
linker->LoadModule(entry.path());
|
|
||||||
}
|
}
|
||||||
|
LOG_INFO(Loader, "Loading {}", entry.path().string().c_str());
|
||||||
|
linker->LoadModule(entry.path());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -445,6 +445,10 @@ vk::Format SurfaceFormat(AmdGpu::DataFormat data_format, AmdGpu::NumberFormat nu
|
|||||||
num_format == AmdGpu::NumberFormat::Unorm) {
|
num_format == AmdGpu::NumberFormat::Unorm) {
|
||||||
return vk::Format::eR16G16B16A16Unorm;
|
return vk::Format::eR16G16B16A16Unorm;
|
||||||
}
|
}
|
||||||
|
if (data_format == AmdGpu::DataFormat::Format16_16 &&
|
||||||
|
num_format == AmdGpu::NumberFormat::Uint) {
|
||||||
|
return vk::Format::eR16G16Uint;
|
||||||
|
}
|
||||||
if (data_format == AmdGpu::DataFormat::Format8 && num_format == AmdGpu::NumberFormat::Uint) {
|
if (data_format == AmdGpu::DataFormat::Format8 && num_format == AmdGpu::NumberFormat::Uint) {
|
||||||
return vk::Format::eR8Uint;
|
return vk::Format::eR8Uint;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user