mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-07 19:23:14 +00:00
- sceKernelUuidCreate, sceAppContentAppParamGetInt, sceAppContentTemporaryDataMount2 (#199)
- PlayGo - stub libusbd -added /temp0 and /data mounts at emu start. (Ghost Files: Memory of a Crime, Abyss: The Wraiths of Eden) - some posix functions
This commit is contained in:
parent
c5d1d579b1
commit
0fa7d5d02c
19 changed files with 900 additions and 14 deletions
144
src/core/libraries/playgo/playgo.cpp
Normal file
144
src/core/libraries/playgo/playgo.cpp
Normal file
|
@ -0,0 +1,144 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "common/singleton.h"
|
||||
#include "core/libraries/error_codes.h"
|
||||
#include "core/libraries/libs.h"
|
||||
#include "playgo.h"
|
||||
|
||||
namespace Libraries::PlayGo {
|
||||
// this lib is used to play as the game is being installed.
|
||||
// can be skipped by just returning and assigning the correct values.
|
||||
|
||||
s32 PS4_SYSV_ABI sceDbgPlayGoRequestNextChunk() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceDbgPlayGoSnapshot() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoClose() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoGetChunkId() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoGetEta() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoGetInstallSpeed() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoGetLanguageMask(OrbisPlayGoHandle handle,
|
||||
OrbisPlayGoLanguageMask* languageMask) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
*languageMask = 1; // En, todo;
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoGetLocus(OrbisPlayGoHandle handle, const OrbisPlayGoChunkId* chunkIds,
|
||||
uint32_t numberOfEntries, OrbisPlayGoLocus* outLoci) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called handle = {}, chunkIds = {}, numberOfEntries = {}",
|
||||
handle, *chunkIds, numberOfEntries);
|
||||
// assign all now so that scePlayGoGetLocus is not called again for every single entry
|
||||
std::fill(outLoci, outLoci + numberOfEntries,
|
||||
OrbisPlayGoLocusValue::ORBIS_PLAYGO_LOCUS_LOCAL_FAST);
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoGetProgress(OrbisPlayGoHandle handle, const OrbisPlayGoChunkId* chunkIds,
|
||||
uint32_t numberOfEntries, OrbisPlayGoProgress* outProgress) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called handle = {}, chunkIds = {}, numberOfEntries = {}",
|
||||
handle, *chunkIds, numberOfEntries);
|
||||
outProgress->progressSize = 0x10000; // todo?
|
||||
outProgress->totalSize = 0x10000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoGetToDoList(OrbisPlayGoHandle handle, OrbisPlayGoToDo* outTodoList,
|
||||
u32 numberOfEntries, u32* outEntries) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
if (handle != shadMagic)
|
||||
return ORBIS_PLAYGO_ERROR_BAD_HANDLE;
|
||||
if (outTodoList == nullptr)
|
||||
return ORBIS_PLAYGO_ERROR_BAD_POINTER;
|
||||
*outEntries = 0; // nothing to do
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoInitialize(OrbisPlayGoInitParams* param) {
|
||||
if (param->bufAddr == nullptr)
|
||||
return ORBIS_PLAYGO_ERROR_BAD_POINTER;
|
||||
if (param->bufSize < 0x200000)
|
||||
return ORBIS_PLAYGO_ERROR_BAD_SIZE;
|
||||
LOG_INFO(Lib_PlayGo, "(STUBBED)called, bufSize = {}", param->bufSize);
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoOpen(OrbisPlayGoHandle* outHandle, const void* param) {
|
||||
*outHandle = shadMagic;
|
||||
LOG_INFO(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoPrefetch() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoSetInstallSpeed() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoSetLanguageMask(OrbisPlayGoHandle handle,
|
||||
OrbisPlayGoLanguageMask languageMask) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoSetToDoList(OrbisPlayGoHandle handle, const OrbisPlayGoToDo* todoList,
|
||||
uint32_t numberOfEntries) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI scePlayGoTerminate() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
void RegisterlibScePlayGo(Core::Loader::SymbolsResolver* sym) {
|
||||
LIB_FUNCTION("uEqMfMITvEI", "libSceDbgPlayGo", 1, "libScePlayGo", 1, 0,
|
||||
sceDbgPlayGoRequestNextChunk);
|
||||
LIB_FUNCTION("vU+FqrH+pEY", "libSceDbgPlayGo", 1, "libScePlayGo", 1, 0, sceDbgPlayGoSnapshot);
|
||||
LIB_FUNCTION("Uco1I0dlDi8", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoClose);
|
||||
LIB_FUNCTION("73fF1MFU8hA", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoGetChunkId);
|
||||
LIB_FUNCTION("v6EZ-YWRdMs", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoGetEta);
|
||||
LIB_FUNCTION("rvBSfTimejE", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoGetInstallSpeed);
|
||||
LIB_FUNCTION("3OMbYZBaa50", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoGetLanguageMask);
|
||||
LIB_FUNCTION("uWIYLFkkwqk", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoGetLocus);
|
||||
LIB_FUNCTION("-RJWNMK3fC8", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoGetProgress);
|
||||
LIB_FUNCTION("Nn7zKwnA5q0", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoGetToDoList);
|
||||
LIB_FUNCTION("ts6GlZOKRrE", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoInitialize);
|
||||
LIB_FUNCTION("M1Gma1ocrGE", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoOpen);
|
||||
LIB_FUNCTION("-Q1-u1a7p0g", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoPrefetch);
|
||||
LIB_FUNCTION("4AAcTU9R3XM", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoSetInstallSpeed);
|
||||
LIB_FUNCTION("LosLlHOpNqQ", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoSetLanguageMask);
|
||||
LIB_FUNCTION("gUPGiOQ1tmQ", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoSetToDoList);
|
||||
LIB_FUNCTION("MPe0EeBGM-E", "libScePlayGo", 1, "libScePlayGo", 1, 0, scePlayGoTerminate);
|
||||
};
|
||||
|
||||
} // namespace Libraries::PlayGo
|
40
src/core/libraries/playgo/playgo.h
Normal file
40
src/core/libraries/playgo/playgo.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
#include "common/types.h"
|
||||
#include "playgo_types.h"
|
||||
|
||||
namespace Core::Loader {
|
||||
class SymbolsResolver;
|
||||
}
|
||||
|
||||
namespace Libraries::PlayGo {
|
||||
constexpr int shadMagic = 0x53484144;
|
||||
|
||||
s32 PS4_SYSV_ABI sceDbgPlayGoRequestNextChunk();
|
||||
s32 PS4_SYSV_ABI sceDbgPlayGoSnapshot();
|
||||
s32 PS4_SYSV_ABI scePlayGoClose();
|
||||
s32 PS4_SYSV_ABI scePlayGoGetChunkId();
|
||||
s32 PS4_SYSV_ABI scePlayGoGetEta();
|
||||
s32 PS4_SYSV_ABI scePlayGoGetInstallSpeed();
|
||||
s32 PS4_SYSV_ABI scePlayGoGetLanguageMask(OrbisPlayGoHandle handle,
|
||||
OrbisPlayGoLanguageMask* outLanguageMask);
|
||||
s32 PS4_SYSV_ABI scePlayGoGetLocus(OrbisPlayGoHandle handle, const OrbisPlayGoChunkId* chunkIds,
|
||||
uint32_t numberOfEntries, OrbisPlayGoLocus* outLoci);
|
||||
s32 PS4_SYSV_ABI scePlayGoGetProgress(OrbisPlayGoHandle handle, const OrbisPlayGoChunkId* chunkIds,
|
||||
uint32_t numberOfEntries, OrbisPlayGoProgress* outProgress);
|
||||
s32 PS4_SYSV_ABI scePlayGoGetToDoList(OrbisPlayGoHandle handle, OrbisPlayGoToDo* outTodoList,
|
||||
u32 numberOfEntries, u32* outEntries);
|
||||
s32 PS4_SYSV_ABI scePlayGoInitialize(OrbisPlayGoInitParams* param);
|
||||
s32 PS4_SYSV_ABI scePlayGoOpen(OrbisPlayGoHandle* outHandle, const void* param);
|
||||
s32 PS4_SYSV_ABI scePlayGoPrefetch();
|
||||
s32 PS4_SYSV_ABI scePlayGoSetInstallSpeed();
|
||||
s32 PS4_SYSV_ABI scePlayGoSetLanguageMask(OrbisPlayGoHandle handle,
|
||||
OrbisPlayGoLanguageMask languageMask);
|
||||
s32 PS4_SYSV_ABI scePlayGoSetToDoList(OrbisPlayGoHandle handle, const OrbisPlayGoToDo* todoList,
|
||||
uint32_t numberOfEntries);
|
||||
s32 PS4_SYSV_ABI scePlayGoTerminate();
|
||||
|
||||
void RegisterlibScePlayGo(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::PlayGo
|
60
src/core/libraries/playgo/playgo_types.h
Normal file
60
src/core/libraries/playgo/playgo_types.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
typedef u32 OrbisPlayGoHandle;
|
||||
typedef u16 OrbisPlayGoChunkId;
|
||||
typedef s8 OrbisPlayGoLocus;
|
||||
typedef s32 OrbisPlayGoInstallSpeed;
|
||||
typedef s64 OrbisPlayGoEta;
|
||||
typedef u64 OrbisPlayGoLanguageMask;
|
||||
|
||||
typedef struct OrbisPlayGoInitParams {
|
||||
const void* bufAddr;
|
||||
u32 bufSize;
|
||||
u32 reserved;
|
||||
} OrbisPlayGoInitParams;
|
||||
|
||||
typedef struct OrbisPlayGoToDo {
|
||||
OrbisPlayGoChunkId chunkId;
|
||||
OrbisPlayGoLocus locus;
|
||||
s8 reserved;
|
||||
} OrbisPlayGoToDo;
|
||||
|
||||
typedef struct OrbisPlayGoProgress {
|
||||
uint64_t progressSize;
|
||||
uint64_t totalSize;
|
||||
} OrbisPlayGoProgress;
|
||||
|
||||
typedef enum OrbisPlayGoLocusValue {
|
||||
ORBIS_PLAYGO_LOCUS_NOT_DOWNLOADED = 0,
|
||||
ORBIS_PLAYGO_LOCUS_LOCAL_SLOW = 2,
|
||||
ORBIS_PLAYGO_LOCUS_LOCAL_FAST = 3
|
||||
} OrbisPlayGoLocusValue;
|
||||
|
||||
typedef enum OrbisPlayGoInstallSpeedValue {
|
||||
ORBIS_PLAYGO_INSTALL_SPEED_SUSPENDED = 0,
|
||||
ORBIS_PLAYGO_INSTALL_SPEED_TRICKLE = 1,
|
||||
ORBIS_PLAYGO_INSTALL_SPEED_FULL = 2
|
||||
} OrbisPlayGoInstallSpeedValue;
|
||||
|
||||
constexpr int ORBIS_PLAYGO_ERROR_UNKNOWN = -2135818239; /* 0x80B20001 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_FATAL = -2135818238; /* 0x80B20002 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_NO_MEMORY = -2135818237; /* 0x80B20003 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_INVALID_ARGUMENT = -2135818236; /* 0x80B20004 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_NOT_INITIALIZED = -2135818235; /* 0x80B20005 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_ALREADY_INITIALIZED = -2135818234; /* 0x80B20006 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_ALREADY_STARTED = -2135818233; /* 0x80B20007 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_NOT_STARTED = -2135818232; /* 0x80B20008 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_BAD_HANDLE = -2135818231; /* 0x80B20009 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_BAD_POINTER = -2135818230; /* 0x80B2000A */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_BAD_SIZE = -2135818229; /* 0x80B2000B */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_BAD_CHUNK_ID = -2135818228; /* 0x80B2000C */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_BAD_SPEED = -2135818227; /* 0x80B2000D */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_NOT_SUPPORT_PLAYGO = -2135818226; /* 0x80B2000E */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_EPERM = -2135818225; /* 0x80B2000F */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_BAD_LOCUS = -2135818224; /* 0x80B20010 */
|
||||
constexpr int ORBIS_PLAYGO_ERROR_NEED_DATA_DISC = -2135818223; /* 0x80B20011 */
|
Loading…
Add table
Add a link
Reference in a new issue