Fix libSceNgs2 HLE regressions (#2732)

* Fix sceNgs2SystemCreateWithAllocator

The cause of the exceptions without libraries.

* Remove error handling for unimplemented functions

Since nothing exists to create any VoiceHandle or RackHandle, we were consistently hitting those error returns.
Also promotes logs for stubbed functions back to LOG_ERROR, with the exception of two functions that get spammed pretty frequently.

* Use Core::ExecuteGuest to execute allocator alloc and free

* Clang

* Fix function definitions in ngs2.h

These should be using the SYSV ABI

* Fix function defs in ngs2_impl.h

This will (hopefully) fix compilation

* Clang

* Clang

again
This commit is contained in:
Stephen Miller 2025-04-01 00:57:47 -05:00 committed by GitHub
parent a2a1ecde0a
commit 01243fb8e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 60 additions and 118 deletions

View file

@ -16,7 +16,8 @@ class SymbolsResolver;
namespace Libraries::Ngs2 {
typedef s32 (*OrbisNgs2ParseReadHandler)(uintptr_t userData, u32 offset, void* data, size_t size);
using OrbisNgs2ParseReadHandler = s32 PS4_SYSV_ABI (*)(uintptr_t user_data, u32 offset, void* data,
size_t size);
enum class OrbisNgs2HandleType : u32 {
Invalid = 0,
@ -90,7 +91,7 @@ struct OrbisNgs2UserFxProcessContext {
u32 sampleRate;
};
typedef s32 (*OrbisNgs2UserFxProcessHandler)(OrbisNgs2UserFxProcessContext* context);
using OrbisNgs2UserFxProcessHandler = s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFxProcessContext* context);
struct OrbisNgs2UserFx2SetupContext {
void* common;
@ -102,7 +103,7 @@ struct OrbisNgs2UserFx2SetupContext {
u64 reserved[4];
};
typedef s32 (*OrbisNgs2UserFx2SetupHandler)(OrbisNgs2UserFx2SetupContext* context);
using OrbisNgs2UserFx2SetupHandler = s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFx2SetupContext* context);
struct OrbisNgs2UserFx2CleanupContext {
void* common;
@ -114,7 +115,8 @@ struct OrbisNgs2UserFx2CleanupContext {
u64 reserved[4];
};
typedef s32 (*OrbisNgs2UserFx2CleanupHandler)(OrbisNgs2UserFx2CleanupContext* context);
using OrbisNgs2UserFx2CleanupHandler =
s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFx2CleanupContext* context);
struct OrbisNgs2UserFx2ControlContext {
const void* data;
@ -125,7 +127,8 @@ struct OrbisNgs2UserFx2ControlContext {
u64 reserved[4];
};
typedef s32 (*OrbisNgs2UserFx2ControlHandler)(OrbisNgs2UserFx2ControlContext* context);
using OrbisNgs2UserFx2ControlHandler =
s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFx2ControlContext* context);
struct OrbisNgs2UserFx2ProcessContext {
float** aChannelData;
@ -143,7 +146,8 @@ struct OrbisNgs2UserFx2ProcessContext {
u64 reserved2[4];
};
typedef s32 (*OrbisNgs2UserFx2ProcessHandler)(OrbisNgs2UserFx2ProcessContext* context);
using OrbisNgs2UserFx2ProcessHandler =
s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFx2ProcessContext* context);
struct OrbisNgs2BufferAllocator {
OrbisNgs2BufferAllocHandler allocHandler;
@ -237,7 +241,7 @@ struct OrbisNgs2VoiceCallbackInfo {
} param;
};
typedef void (*OrbisNgs2VoiceCallbackHandler)(const OrbisNgs2VoiceCallbackInfo* info);
using OrbisNgs2VoiceCallbackHandler = void PS4_SYSV_ABI (*)(const OrbisNgs2VoiceCallbackInfo* info);
struct OrbisNgs2VoiceCallbackParam {
OrbisNgs2VoiceParamHeader header;