Stabilization8 (#218)

* disable configured flexible memory size (caused issues in some games)

* fixed case S_OR_B64 for blazing chrome

* submodules updates and fixes for latest SDL

* stubbed _sigprocmask (not handled and spams too much)

* added ReplaceOp case in Stencilop

* dummy ajm module added
This commit is contained in:
georgemoralis 2024-06-27 16:37:17 +03:00 committed by GitHub
parent f5541e3c3d
commit 0ada442cbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 214 additions and 13 deletions

View file

@ -111,6 +111,8 @@ set(AUDIO_LIB src/core/libraries/audio/audioin.cpp
src/core/libraries/audio/audioin.h
src/core/libraries/audio/audioout.cpp
src/core/libraries/audio/audioout.h
src/core/libraries/ajm/ajm.cpp
src/core/libraries/ajm/ajm.h
)
set(GNM_LIB src/core/libraries/gnmdriver/gnmdriver.cpp

2
externals/cryptopp vendored

@ -1 +1 @@
Subproject commit 9bb6680cfaedd3d46eff082ede8d0c76be6a2145
Subproject commit 60f81a77e0c9a0e7ffc1ca1bc438ddfa2e43b78e

2
externals/fmt vendored

@ -1 +1 @@
Subproject commit 18a325f370ffd5ec1eda0087d2efc3dc9b3faf56
Subproject commit bbf44cc000531dc7737d5321ccfa9f2f11b20127

2
externals/glslang vendored

@ -1 +1 @@
Subproject commit 2d8b71fc63578a93726c05e0565c3ef064bdc1ba
Subproject commit ea087ff90d03947307cfe52500b74551aa35d34d

2
externals/sdl3 vendored

@ -1 +1 @@
Subproject commit 4fc68a48f20574326eb18022eed0b7c0fa52a10e
Subproject commit a4f962fd46b5b0b4ed9d5eb1e40a203cc0e5f422

2
externals/vma vendored

@ -1 +1 @@
Subproject commit 7942b798289f752dc23b0a79516fd8545febd718
Subproject commit feb11e172715011ef2a7b3b6c7c8737337b34181

2
externals/zlib-ng vendored

@ -1 +1 @@
Subproject commit 2e3e5f30a05ee7b113c755ad9a075304e02bc328
Subproject commit 80514c17b384df68fbe83cca69ece0521b85f708

View file

@ -78,7 +78,7 @@ int SDLAudio::AudioOutOpen(int type, u32 samples_num, u32 freq,
fmt.channels = port.channels_num;
fmt.freq = 48000;
port.stream =
SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_OUTPUT, &fmt, NULL, NULL);
SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &fmt, NULL, NULL);
SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(port.stream));
return id + 1;
}

View file

@ -107,6 +107,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
SUB(Lib, Png) \
SUB(Lib, PlayGo) \
SUB(Lib, Usbd) \
SUB(Lib, Ajm) \
CLS(Frontend) \
CLS(Render) \
SUB(Render, Vulkan) \

View file

@ -74,6 +74,7 @@ enum class Class : u8 {
Lib_Png, ///< The LibScePng implementation.
Lib_PlayGo, ///< The LibScePlayGo implementation.
Lib_Usbd, ///< The LibSceUsbd implementation.
Lib_Ajm, ///< The LibSceAjm implementation.
Frontend, ///< Emulator UI
Render, ///< Video Core
Render_Vulkan, ///< Vulkan backend

View file

@ -0,0 +1,147 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "common/logging/log.h"
#include "core/libraries/ajm/ajm.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
namespace Libraries::Ajm {
int PS4_SYSV_ABI sceAjmBatchCancel() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmBatchErrorDump() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmBatchJobControlBufferRa() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmBatchJobInlineBuffer() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmBatchJobRunBufferRa() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmBatchJobRunSplitBufferRa() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmBatchStartBuffer() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmBatchWait() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmDecAt9ParseConfigData() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmDecMp3ParseFrame() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmFinalize() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmInitialize() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmInstanceCodecType() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmInstanceCreate() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmInstanceDestroy() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmInstanceExtend() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmInstanceSwitch() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmMemoryRegister() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmMemoryUnregister() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmModuleRegister() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmModuleUnregister() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAjmStrError() {
LOG_ERROR(Lib_Ajm, "(STUBBED) called");
return ORBIS_OK;
}
void RegisterlibSceAjm(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("NVDXiUesSbA", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchCancel);
LIB_FUNCTION("WfAiBW8Wcek", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchErrorDump);
LIB_FUNCTION("dmDybN--Fn8", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchJobControlBufferRa);
LIB_FUNCTION("stlghnic3Jc", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchJobInlineBuffer);
LIB_FUNCTION("ElslOCpOIns", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchJobRunBufferRa);
LIB_FUNCTION("7jdAXK+2fMo", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchJobRunSplitBufferRa);
LIB_FUNCTION("fFFkk0xfGWs", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchStartBuffer);
LIB_FUNCTION("-qLsfDAywIY", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchWait);
LIB_FUNCTION("1t3ixYNXyuc", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmDecAt9ParseConfigData);
LIB_FUNCTION("eDFeTyi+G3Y", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmDecMp3ParseFrame);
LIB_FUNCTION("MHur6qCsUus", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmFinalize);
LIB_FUNCTION("dl+4eHSzUu4", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmInitialize);
LIB_FUNCTION("diXjQNiMu-s", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmInstanceCodecType);
LIB_FUNCTION("AxoDrINp4J8", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmInstanceCreate);
LIB_FUNCTION("RbLbuKv8zho", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmInstanceDestroy);
LIB_FUNCTION("YDFR0dDVGAg", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmInstanceExtend);
LIB_FUNCTION("rgLjmfdXocI", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmInstanceSwitch);
LIB_FUNCTION("bkRHEYG6lEM", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmMemoryRegister);
LIB_FUNCTION("pIpGiaYkHkM", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmMemoryUnregister);
LIB_FUNCTION("Q3dyFuwGn64", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmModuleRegister);
LIB_FUNCTION("Wi7DtlLV+KI", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmModuleUnregister);
LIB_FUNCTION("AxhcqVv5AYU", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmStrError);
};
} // namespace Libraries::Ajm

View file

@ -0,0 +1,38 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::Ajm {
int PS4_SYSV_ABI sceAjmBatchCancel();
int PS4_SYSV_ABI sceAjmBatchErrorDump();
int PS4_SYSV_ABI sceAjmBatchJobControlBufferRa();
int PS4_SYSV_ABI sceAjmBatchJobInlineBuffer();
int PS4_SYSV_ABI sceAjmBatchJobRunBufferRa();
int PS4_SYSV_ABI sceAjmBatchJobRunSplitBufferRa();
int PS4_SYSV_ABI sceAjmBatchStartBuffer();
int PS4_SYSV_ABI sceAjmBatchWait();
int PS4_SYSV_ABI sceAjmDecAt9ParseConfigData();
int PS4_SYSV_ABI sceAjmDecMp3ParseFrame();
int PS4_SYSV_ABI sceAjmFinalize();
int PS4_SYSV_ABI sceAjmInitialize();
int PS4_SYSV_ABI sceAjmInstanceCodecType();
int PS4_SYSV_ABI sceAjmInstanceCreate();
int PS4_SYSV_ABI sceAjmInstanceDestroy();
int PS4_SYSV_ABI sceAjmInstanceExtend();
int PS4_SYSV_ABI sceAjmInstanceSwitch();
int PS4_SYSV_ABI sceAjmMemoryRegister();
int PS4_SYSV_ABI sceAjmMemoryUnregister();
int PS4_SYSV_ABI sceAjmModuleRegister();
int PS4_SYSV_ABI sceAjmModuleUnregister();
int PS4_SYSV_ABI sceAjmStrError();
void RegisterlibSceAjm(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::Ajm

View file

@ -297,12 +297,18 @@ int PS4_SYSV_ABI posix_connect() {
return -1;
}
int PS4_SYSV_ABI _sigprocmask() {
LOG_DEBUG(Lib_Kernel, "STUBBED");
return ORBIS_OK;
}
void LibKernel_Register(Core::Loader::SymbolsResolver* sym) {
// obj
LIB_OBJ("f7uOxY9mM1U", "libkernel", 1, "libkernel", 1, 1, &g_stack_chk_guard);
// misc
LIB_FUNCTION("JGfTMBOdUJo", "libkernel", 1, "libkernel", 1, 1, sceKernelGetFsSandboxRandomWord);
LIB_FUNCTION("XVL8So3QJUk", "libkernel", 1, "libkernel", 1, 1, posix_connect);
LIB_FUNCTION("6xVpy0Fdq+I", "libkernel", 1, "libkernel", 1, 1, _sigprocmask);
// memory
LIB_FUNCTION("OMDRKKAZ8I4", "libkernel", 1, "libkernel", 1, 1, sceKernelDebugRaiseException);
LIB_FUNCTION("rTXw65xmLIA", "libkernel", 1, "libkernel", 1, 1, sceKernelAllocateDirectMemory);

View file

@ -32,6 +32,7 @@
#include "core/libraries/system/userservice.h"
#include "core/libraries/usbd/usbd.h"
#include "core/libraries/videoout/video_out.h"
#include "src/core/libraries/ajm/ajm.h"
#include "src/core/libraries/libpng/pngdec.h"
namespace Libraries {
@ -68,6 +69,7 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
Libraries::PlayGo::RegisterlibScePlayGo(sym);
Libraries::Usbd::RegisterlibSceUsbd(sym);
Libraries::Pad::RegisterlibScePad(sym);
Libraries::Ajm::RegisterlibSceAjm(sym);
}
} // namespace Libraries

View file

@ -68,11 +68,11 @@ void Linker::Execute() {
}
// Configure used flexible memory size.
if (auto* mem_param = GetProcParam()->mem_param) {
if (u64* flexible_size = mem_param->flexible_memory_size) {
memory->SetTotalFlexibleSize(*flexible_size);
}
}
// if (auto* mem_param = GetProcParam()->mem_param) {
// if (u64* flexible_size = mem_param->flexible_memory_size) {
// memory->SetTotalFlexibleSize(*flexible_size);
// }
// }
// Init primary thread.
Common::SetCurrentThreadName("GAME_MainThread");

View file

@ -102,7 +102,7 @@ void WindowSDL::onKeyPress(const SDL_Event* event) {
Input::Axis axis = Input::Axis::AxisMax;
int axisvalue = 0;
int ax = 0;
switch (event->key.keysym.sym) {
switch (event->key.key) {
case SDLK_UP:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_UP;
break;

View file

@ -107,6 +107,8 @@ void Translator::S_MOV_B64(const GcnInst& inst) {
void Translator::S_OR_B64(NegateMode negate, const GcnInst& inst) {
const auto get_src = [&](const InstOperand& operand) {
switch (operand.field) {
case OperandField::ExecLo:
return ir.GetExec();
case OperandField::VccLo:
return ir.GetVcc();
case OperandField::ScalarGPR:

View file

@ -26,6 +26,8 @@ vk::StencilOp StencilOp(Liverpool::StencilFunc op) {
return vk::StencilOp::eIncrementAndWrap;
case Liverpool::StencilFunc::SubWrap:
return vk::StencilOp::eDecrementAndWrap;
case Liverpool::StencilFunc::ReplaceOp:
return vk::StencilOp::eReplace;
default:
UNREACHABLE();
return vk::StencilOp::eKeep;