Added sysv_abi , now parameters in sceVideoOutOpen is correct

This commit is contained in:
georgemoralis 2023-07-21 08:03:36 +03:00
parent d8140ca016
commit 28aad0a5dc
7 changed files with 49 additions and 36 deletions

View File

@ -1,27 +1,38 @@
{ {
"configurations": [ "configurations": [
{ {
"name": "x64-Debug", "name": "x64-Debug",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "Debug", "configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ], "inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}", "buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}", "installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "", "cmakeCommandArgs": "",
"buildCommandArgs": "", "buildCommandArgs": "",
"ctestCommandArgs": "" "ctestCommandArgs": ""
}, },
{ {
"name": "x64-Release", "name": "x64-Release",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "Release", "configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}", "buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}", "installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "", "cmakeCommandArgs": "",
"buildCommandArgs": "", "buildCommandArgs": "",
"ctestCommandArgs": "", "ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ], "inheritEnvironments": [ "msvc_x64_x64" ]
"variables": [] },
} {
] "name": "x64-Clang-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "clang_cl_x64_x64" ],
"variables": []
}
]
} }

View File

@ -6,7 +6,7 @@ namespace HLE::Libs::LibC {
static u32 g_need_sceLibc = 1; static u32 g_need_sceLibc = 1;
static void init_env() //every game/demo should probably static PS4_SYSV_ABI void init_env() // every game/demo should probably
{ {
//dummy no need atm //dummy no need atm
} }
@ -35,7 +35,7 @@ namespace HLE::Libs::LibC {
{ {
} }
static int atexit(void (*func)()) static PS4_SYSV_ABI int atexit(void (*func)())
{ {
int rt = ::atexit(func); int rt = ::atexit(func);
if (rt != 0) if (rt != 0)

View File

@ -5,8 +5,8 @@ namespace HLE::Libs::LibC {
void LibC_Register(SymbolsResolver* sym); void LibC_Register(SymbolsResolver* sym);
//functions //functions
static void init_env(); static PS4_SYSV_ABI void init_env();
static void exit(int code); static PS4_SYSV_ABI void exit(int code);
static void catchReturnFromMain(int status); static void catchReturnFromMain(int status);
int __cxa_guard_acquire(u64* guard_object); int __cxa_guard_acquire(u64* guard_object);
int memcmp(const void* s1, const void* s2, size_t n); int memcmp(const void* s1, const void* s2, size_t n);

View File

@ -31,7 +31,7 @@ namespace HLE::Libs::LibSceVideoOut {
} }
int32_t sceVideoOutOpen(SceUserServiceUserId userId, int32_t busType, int32_t index, const void* param) int32_t PS4_SYSV_ABI sceVideoOutOpen(SceUserServiceUserId userId, int32_t busType, int32_t index, const void* param)
{ {
if (busType != 0) if (busType != 0)
{ {

View File

@ -15,6 +15,6 @@ int32_t sceVideoOutSetFlipRate(int32_t handle, int32_t rate);
void sceVideoOutSetBufferAttribute(/* SceVideoOutBufferAttribute* attribute,*/ uint32_t pixelFormat, uint32_t tilingMode, uint32_t aspectRatio, void sceVideoOutSetBufferAttribute(/* SceVideoOutBufferAttribute* attribute,*/ uint32_t pixelFormat, uint32_t tilingMode, uint32_t aspectRatio,
uint32_t width, uint32_t height, uint32_t pitchInPixel); uint32_t width, uint32_t height, uint32_t pitchInPixel);
int32_t sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/); int32_t sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/);
int32_t sceVideoOutOpen(SceUserServiceUserId userId,int32_t busType, int32_t index, const void* param); int32_t PS4_SYSV_ABI sceVideoOutOpen(SceUserServiceUserId userId, int32_t busType, int32_t index, const void* param);
int32_t sceVideoOutIsFlipPending(int32_t handle); int32_t sceVideoOutIsFlipPending(int32_t handle);
}; // namespace HLE::Libs::LibSceVideoOut }; // namespace HLE::Libs::LibSceVideoOut

View File

@ -631,15 +631,15 @@ void Linker::Resolve(const std::string& name, int Symtype, Module* m, SymbolReco
} }
using exit_func_t = void (*)(); using exit_func_t = PS4_SYSV_ABI void (*)();
using entry_func_t = void (*)(EntryParams* params, exit_func_t atexit_func); using entry_func_t = PS4_SYSV_ABI void (*)(EntryParams* params, exit_func_t atexit_func);
static void ProgramExitFunc() { static PS4_SYSV_ABI void ProgramExitFunc() {
printf("exit function called\n"); printf("exit function called\n");
} }
static void run_main_entry(u64 addr, EntryParams* params, exit_func_t exit_func) { static PS4_SYSV_ABI void run_main_entry(u64 addr, EntryParams* params, exit_func_t exit_func) {
reinterpret_cast<entry_func_t>(addr)(params, exit_func); reinterpret_cast<entry_func_t>(addr)(params, exit_func);
} }

View File

@ -12,3 +12,5 @@ using u64 = unsigned long long;
using f32 = float; using f32 = float;
using f64 = double; using f64 = double;
#define PS4_SYSV_ABI __attribute__((sysv_abi))