commit
408cb39da0
|
@ -1,27 +1,26 @@
|
|||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": ""
|
||||
},
|
||||
{
|
||||
"name": "x64-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": []
|
||||
}
|
||||
]
|
||||
"configurations": [
|
||||
{
|
||||
"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" ]
|
||||
},
|
||||
{
|
||||
"name": "x64-Clang-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "clang_cl_x64_x64" ]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
# How to build shadps4 in windows
|
||||
|
||||
## Download VStudio Community 2022 17.7
|
||||
|
||||
Atm it is on preview stage but there seems to be issues using clang + cmake + ninja in the current vstudio (17.6.5 )
|
||||
[vstudio 17.6.5 bug](https://developercommunity.visualstudio.com/t/cmake-generates-bad-dependencies-for-rc/10398924?q=cmake%20dependencies)
|
||||
|
||||
So here is the link for vstudio 2020 17.7 preview (atm it is in preview 4)
|
||||
|
||||
|
||||
[vstudio 17.7 preview](https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview)
|
||||
|
||||
## Requirements
|
||||
|
||||
Install the following
|
||||
|
||||
- Desktop development with c++
|
||||
|
||||
### From Individual components tab install
|
||||
|
||||
- C++ Clang Compiler for Windows (16.0.5)
|
||||
- MSBuild support for LLVM (clang-cl) toolset
|
||||
|
||||
- ## Compiling
|
||||
|
||||
- Open vstudio and select the clang debug or clang release . It should compile just fine
|
|
@ -6,36 +6,38 @@ namespace HLE::Libs::LibC {
|
|||
|
||||
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
|
||||
}
|
||||
|
||||
int __cxa_guard_acquire(u64* guard_object)
|
||||
{ return 0;
|
||||
int PS4_SYSV_ABI __cxa_guard_acquire(u64* guard_object)
|
||||
{
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __cxa_guard_release(u64* guard_object)
|
||||
{ return 0;
|
||||
int PS4_SYSV_ABI __cxa_guard_release(u64* guard_object)
|
||||
{
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int memcmp(const void* s1, const void* s2, size_t n) {
|
||||
int PS4_SYSV_ABI memcmp(const void* s1, const void* s2, size_t n) {
|
||||
return ::memcmp(s1, s2, n);
|
||||
}
|
||||
|
||||
void* memcpy(void* dest, const void* src, size_t n) {
|
||||
void* PS4_SYSV_ABI memcpy(void* dest, const void* src, size_t n) {
|
||||
return ::memcpy(dest, src, n);
|
||||
}
|
||||
|
||||
static void catchReturnFromMain(int status)
|
||||
{
|
||||
|
||||
static PS4_SYSV_ABI void catchReturnFromMain(int status)
|
||||
{ __debugbreak();
|
||||
}
|
||||
static void exit(int code)
|
||||
{
|
||||
|
||||
static PS4_SYSV_ABI void exit(int code)
|
||||
{ __debugbreak();
|
||||
}
|
||||
static int atexit(void (*func)())
|
||||
static PS4_SYSV_ABI int atexit(void (*func)())
|
||||
{
|
||||
int rt = ::atexit(func);
|
||||
if (rt != 0)
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
namespace HLE::Libs::LibC {
|
||||
|
||||
void LibC_Register(SymbolsResolver* sym);
|
||||
|
||||
//functions
|
||||
static void init_env();
|
||||
static void exit(int code);
|
||||
static void catchReturnFromMain(int status);
|
||||
int __cxa_guard_acquire(u64* guard_object);
|
||||
int memcmp(const void* s1, const void* s2, size_t n);
|
||||
void* memcpy(void* dest, const void* src, size_t n);
|
||||
static PS4_SYSV_ABI void init_env();
|
||||
static PS4_SYSV_ABI void exit(int code);
|
||||
static PS4_SYSV_ABI void catchReturnFromMain(int status);
|
||||
int PS4_SYSV_ABI __cxa_guard_acquire(u64* guard_object);
|
||||
int PS4_SYSV_ABI memcmp(const void* s1, const void* s2, size_t n);
|
||||
void* PS4_SYSV_ABI memcpy(void* dest, const void* src, size_t n);
|
||||
|
||||
};
|
|
@ -6,26 +6,41 @@ namespace HLE::Libs::LibKernel {
|
|||
|
||||
static u64 g_stack_chk_guard = 0xDEADBEEF54321ABC; //dummy return
|
||||
|
||||
int sceKernelAllocateDirectMemory(off_t searchStart, off_t searchEnd, size_t len, size_t alignment, int memoryType, off_t* physAddrOut) { return 0;//OK
|
||||
int PS4_SYSV_ABI sceKernelAllocateDirectMemory(off_t searchStart, off_t searchEnd, size_t len, size_t alignment, int memoryType,
|
||||
off_t* physAddrOut) {
|
||||
__debugbreak();
|
||||
return 0; // OK
|
||||
}
|
||||
size_t sceKernelGetDirectMemorySize() { return 0;
|
||||
size_t PS4_SYSV_ABI sceKernelGetDirectMemorySize() {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
int32_t sceKernelMapDirectMemory(void** addr, size_t len, int prot, int flags, off_t directMemoryStart, size_t alignment) { return 0;
|
||||
int32_t PS4_SYSV_ABI sceKernelMapDirectMemory(void** addr, size_t len, int prot, int flags, off_t directMemoryStart, size_t alignment) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
int32_t sceKernelReleaseDirectMemory(off_t start, size_t len) { return 0;
|
||||
int32_t PS4_SYSV_ABI sceKernelReleaseDirectMemory(off_t start, size_t len) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceKernelCreateEqueue(/* SceKernelEqueue* eq*/int eq,const char* name)
|
||||
{ return 0;
|
||||
int PS4_SYSV_ABI sceKernelCreateEqueue(/* SceKernelEqueue* eq*/ int eq, const char* name)
|
||||
{
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
int sceKernelWaitEqueue(/*SceKernelEqueue eq, SceKernelEvent* ev,*/ int num, int* out /*, SceKernelUseconds* timo*/) { return 0;
|
||||
int PS4_SYSV_ABI sceKernelWaitEqueue(/*SceKernelEqueue eq, SceKernelEvent* ev,*/ int num, int* out /*, SceKernelUseconds* timo*/)
|
||||
{
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
int sceKernelIsNeoMode()
|
||||
{ return 0;
|
||||
int PS4_SYSV_ABI sceKernelIsNeoMode()
|
||||
{
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void stack_chk_fail() {
|
||||
|
||||
static PS4_SYSV_ABI void stack_chk_fail() { __debugbreak();
|
||||
}
|
||||
void LibKernel_Register(SymbolsResolver* sym) {
|
||||
//obj
|
||||
|
|
|
@ -3,12 +3,13 @@
|
|||
namespace HLE::Libs::LibKernel {
|
||||
|
||||
void LibKernel_Register(SymbolsResolver* sym);
|
||||
|
||||
// functions
|
||||
int sceKernelAllocateDirectMemory(off_t searchStart, off_t searchEnd, size_t len, size_t alignment, int memoryType, off_t* physAddrOut);
|
||||
size_t sceKernelGetDirectMemorySize();
|
||||
int sceKernelCreateEqueue(/* SceKernelEqueue* eq*/ int eq, const char* name);
|
||||
int32_t sceKernelMapDirectMemory(void** addr, size_t len, int prot, int flags, off_t directMemoryStart, size_t alignment);
|
||||
int32_t sceKernelReleaseDirectMemory(off_t start, size_t len);
|
||||
int sceKernelIsNeoMode();
|
||||
int sceKernelWaitEqueue(/*SceKernelEqueue eq, SceKernelEvent* ev,*/ int num, int* out /*, SceKernelUseconds* timo*/);
|
||||
int PS4_SYSV_ABI sceKernelAllocateDirectMemory(off_t searchStart, off_t searchEnd, size_t len, size_t alignment, int memoryType, off_t* physAddrOut);
|
||||
size_t PS4_SYSV_ABI sceKernelGetDirectMemorySize();
|
||||
int PS4_SYSV_ABI sceKernelCreateEqueue(/* SceKernelEqueue* eq*/ int eq, const char* name);
|
||||
int32_t PS4_SYSV_ABI sceKernelMapDirectMemory(void** addr, size_t len, int prot, int flags, off_t directMemoryStart, size_t alignment);
|
||||
int32_t PS4_SYSV_ABI sceKernelReleaseDirectMemory(off_t start, size_t len);
|
||||
int PS4_SYSV_ABI sceKernelIsNeoMode();
|
||||
int PS4_SYSV_ABI sceKernelWaitEqueue(/*SceKernelEqueue eq, SceKernelEvent* ev,*/ int num, int* out /*, SceKernelUseconds* timo*/);
|
||||
}; // namespace HLE::Libs::LibKernel
|
|
@ -4,34 +4,41 @@
|
|||
|
||||
namespace HLE::Libs::LibSceVideoOut {
|
||||
|
||||
int32_t sceVideoOutGetFlipStatus(int32_t handle /*, SceVideoOutFlipStatus* status*/){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t sceVideoOutSubmitFlip(int32_t handle, int32_t bufferIndex, int32_t flipMode,int64_t flipArg){
|
||||
return 0;
|
||||
}
|
||||
int32_t sceVideoOutRegisterBuffers(int32_t handle, int32_t startIndex, void* const* addresses, int32_t bufferNum /*,
|
||||
const SceVideoOutBufferAttribute* attribute*/) {
|
||||
int32_t PS4_SYSV_ABI sceVideoOutGetFlipStatus(int32_t handle /*, SceVideoOutFlipStatus* status*/) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
int32_t sceVideoOutAddFlipEvent(/*SceKernelEqueue eq,*/ int32_t handle, void* udata) {
|
||||
return 0;
|
||||
|
||||
int32_t PS4_SYSV_ABI sceVideoOutSubmitFlip(int32_t handle, int32_t bufferIndex, int32_t flipMode, int64_t flipArg) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
int32_t sceVideoOutSetFlipRate(int32_t handle, int32_t rate) {
|
||||
return 0;
|
||||
int32_t PS4_SYSV_ABI sceVideoOutRegisterBuffers(int32_t handle, int32_t startIndex, void* const* addresses, int32_t bufferNum /*,
|
||||
const SceVideoOutBufferAttribute* attribute*/) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
void sceVideoOutSetBufferAttribute(/* SceVideoOutBufferAttribute* attribute,*/ uint32_t pixelFormat, uint32_t tilingMode, uint32_t aspectRatio,
|
||||
int32_t PS4_SYSV_ABI sceVideoOutAddFlipEvent(/*SceKernelEqueue eq,*/ int32_t handle, void* udata) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
int32_t PS4_SYSV_ABI sceVideoOutSetFlipRate(int32_t handle, int32_t rate) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
void PS4_SYSV_ABI sceVideoOutSetBufferAttribute(/* SceVideoOutBufferAttribute* attribute,*/ uint32_t pixelFormat, uint32_t tilingMode,
|
||||
uint32_t aspectRatio,
|
||||
uint32_t width, uint32_t height, uint32_t pitchInPixel)
|
||||
{
|
||||
|
||||
__debugbreak();
|
||||
}
|
||||
int32_t sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/)
|
||||
{ return 0;
|
||||
int32_t PS4_SYSV_ABI sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -50,7 +57,9 @@ namespace HLE::Libs::LibSceVideoOut {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
int32_t sceVideoOutIsFlipPending(int32_t handle) { return 0;
|
||||
int32_t PS4_SYSV_ABI sceVideoOutIsFlipPending(int32_t handle) {
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
void LibSceVideoOut_Register(SymbolsResolver* sym)
|
||||
{
|
||||
|
|
|
@ -3,18 +3,20 @@
|
|||
|
||||
namespace HLE::Libs::LibSceVideoOut {
|
||||
|
||||
typedef int32_t SceUserServiceUserId; //TODO move it to proper place
|
||||
using SceUserServiceUserId = s32; //TODO move it to proper place
|
||||
|
||||
void LibSceVideoOut_Register(SymbolsResolver* sym);
|
||||
//functions
|
||||
int32_t sceVideoOutGetFlipStatus(int32_t handle /*, SceVideoOutFlipStatus* status*/);
|
||||
int32_t sceVideoOutSubmitFlip(int32_t handle, int32_t bufferIndex, int32_t flipMode, int64_t flipArg);
|
||||
int32_t sceVideoOutRegisterBuffers(int32_t handle, int32_t startIndex, void* const* addresses, int32_t bufferNum /*,const SceVideoOutBufferAttribute* attribute*/);
|
||||
int32_t sceVideoOutAddFlipEvent(/*SceKernelEqueue eq,*/ int32_t handle, void* udata);
|
||||
int32_t sceVideoOutSetFlipRate(int32_t handle, int32_t rate);
|
||||
void sceVideoOutSetBufferAttribute(/* SceVideoOutBufferAttribute* attribute,*/ uint32_t pixelFormat, uint32_t tilingMode, uint32_t aspectRatio,
|
||||
int32_t PS4_SYSV_ABI sceVideoOutGetFlipStatus(int32_t handle /*, SceVideoOutFlipStatus* status*/);
|
||||
int32_t PS4_SYSV_ABI sceVideoOutSubmitFlip(int32_t handle, int32_t bufferIndex, int32_t flipMode, int64_t flipArg);
|
||||
int32_t PS4_SYSV_ABI sceVideoOutRegisterBuffers(int32_t handle, int32_t startIndex, void* const* addresses,
|
||||
int32_t bufferNum /*,const SceVideoOutBufferAttribute* attribute*/);
|
||||
int32_t PS4_SYSV_ABI sceVideoOutAddFlipEvent(/*SceKernelEqueue eq,*/ int32_t handle, void* udata);
|
||||
int32_t PS4_SYSV_ABI sceVideoOutSetFlipRate(int32_t handle, int32_t rate);
|
||||
void PS4_SYSV_ABI sceVideoOutSetBufferAttribute(/* SceVideoOutBufferAttribute* attribute,*/ uint32_t pixelFormat, uint32_t tilingMode,
|
||||
uint32_t aspectRatio,
|
||||
uint32_t width, uint32_t height, uint32_t pitchInPixel);
|
||||
int32_t sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/);
|
||||
int32_t sceVideoOutOpen(SceUserServiceUserId userId,int32_t busType, int32_t index, const void* param);
|
||||
int32_t sceVideoOutIsFlipPending(int32_t handle);
|
||||
int32_t PS4_SYSV_ABI sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/);
|
||||
int32_t PS4_SYSV_ABI sceVideoOutOpen(SceUserServiceUserId userId, int32_t busType, int32_t index, const void* param);
|
||||
int32_t PS4_SYSV_ABI sceVideoOutIsFlipPending(int32_t handle);
|
||||
}; // namespace HLE::Libs::LibSceVideoOut
|
|
@ -631,15 +631,15 @@ void Linker::Resolve(const std::string& name, int Symtype, Module* m, SymbolReco
|
|||
|
||||
}
|
||||
|
||||
using exit_func_t = void (*)();
|
||||
using entry_func_t = void (*)(EntryParams* params, exit_func_t atexit_func);
|
||||
using exit_func_t = PS4_SYSV_ABI void (*)();
|
||||
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");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,4 +11,6 @@ using u32 = unsigned int;
|
|||
using u64 = unsigned long long;
|
||||
|
||||
using f32 = float;
|
||||
using f64 = double;
|
||||
using f64 = double;
|
||||
|
||||
#define PS4_SYSV_ABI __attribute__((sysv_abi))
|
Loading…
Reference in New Issue