mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 19:44:46 +00:00
sceAppContentAppParamGetInt, scePlayGoGetLocus, scePlayGoGetProgress
This commit is contained in:
parent
b804095803
commit
ce78165351
6 changed files with 124 additions and 47 deletions
|
@ -56,7 +56,7 @@ std::string PSF::GetString(const std::string& key) {
|
|||
|
||||
u32 PSF::GetInteger(const std::string& key) {
|
||||
if (map_integers.find(key) != map_integers.end()) {
|
||||
return map_integers.at(key); // TODO std::invalid_argument exception if it fails?
|
||||
return map_integers.at(key);
|
||||
}
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -50,9 +50,29 @@ int PS4_SYSV_ABI sceAppContentAddcontUnmount() {
|
|||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceAppContentAppParamGetInt() {
|
||||
LOG_ERROR(Lib_AppContent, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
int PS4_SYSV_ABI sceAppContentAppParamGetInt(OrbisAppContentAppParamId paramId, s32* value) {
|
||||
if (value == nullptr)
|
||||
return 0x80D90002;
|
||||
auto* param_sfo = Common::Singleton<PSF>::Instance();
|
||||
switch (paramId) {
|
||||
case ORBIS_APP_CONTENT_APPPARAM_ID_SKU_FLAG:
|
||||
*value = ORBIS_APP_CONTENT_APPPARAM_SKU_FLAG_FULL;
|
||||
break;
|
||||
case ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_1:
|
||||
*value = param_sfo->GetInteger("USER_DEFINED_PARAM_1");
|
||||
break;
|
||||
case ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_2:
|
||||
*value = param_sfo->GetInteger("USER_DEFINED_PARAM_2");
|
||||
break;
|
||||
case ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_3:
|
||||
*value = param_sfo->GetInteger("USER_DEFINED_PARAM_3");
|
||||
break;
|
||||
case ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_4:
|
||||
*value = param_sfo->GetInteger("USER_DEFINED_PARAM_4");
|
||||
break;
|
||||
}
|
||||
LOG_ERROR(Lib_AppContent, " paramId = {}, value = {}", paramId, *value);
|
||||
return *value == -1 ? 0x80D90005 : ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceAppContentAppParamGetString() {
|
||||
|
@ -152,8 +172,10 @@ int PS4_SYSV_ABI sceAppContentTemporaryDataFormat() {
|
|||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceAppContentTemporaryDataGetAvailableSpaceKb() {
|
||||
int PS4_SYSV_ABI sceAppContentTemporaryDataGetAvailableSpaceKb(
|
||||
const OrbisAppContentMountPoint* mountPoint, size_t* availableSpaceKb) {
|
||||
LOG_ERROR(Lib_AppContent, "(STUBBED) called");
|
||||
*availableSpaceKb = 1073741824;
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
|
@ -170,7 +192,7 @@ int PS4_SYSV_ABI sceAppContentTemporaryDataMount2(OrbisAppContentTemporaryDataOp
|
|||
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
||||
mnt->Mount(mount_dir, mountPoint->data);
|
||||
LOG_INFO(Lib_AppContent, "sceAppContentTemporaryDataMount2: option = {}, mountPoint = {}",
|
||||
(option & 1), mountPoint->data);
|
||||
option, mountPoint->data);
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,15 @@ class SymbolsResolver;
|
|||
|
||||
namespace Libraries::AppContent {
|
||||
|
||||
constexpr int ORBIS_APP_CONTENT_APPPARAM_ID_SKU_FLAG = 0;
|
||||
constexpr int ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_1 = 1;
|
||||
constexpr int ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_2 = 2;
|
||||
constexpr int ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_3 = 3;
|
||||
constexpr int ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_4 = 4;
|
||||
|
||||
constexpr int ORBIS_APP_CONTENT_APPPARAM_SKU_FLAG_TRIAL = 1;
|
||||
constexpr int ORBIS_APP_CONTENT_APPPARAM_SKU_FLAG_FULL = 3;
|
||||
|
||||
struct OrbisAppContentInitParam {
|
||||
char reserved[32];
|
||||
};
|
||||
|
@ -28,6 +37,16 @@ typedef struct OrbisAppContentMountPoint {
|
|||
char data[ORBIS_APP_CONTENT_MOUNTPOINT_DATA_MAXSIZE];
|
||||
} OrbisAppContentMountPoint;
|
||||
|
||||
constexpr int ORBIS_APP_CONTENT_TEMPORARY_DATA_OPTION_NONE = 0;
|
||||
constexpr int ORBIS_APP_CONTENT_TEMPORARY_DATA_OPTION_FORMAT = (1 << 0);
|
||||
constexpr int ORBIS_NP_UNIFIED_ENTITLEMENT_LABEL_SIZE = 17;
|
||||
typedef struct OrbisNpUnifiedEntitlementLabel {
|
||||
|
||||
char data[ORBIS_NP_UNIFIED_ENTITLEMENT_LABEL_SIZE];
|
||||
} OrbisNpUnifiedEntitlementLabel;
|
||||
|
||||
typedef u32 OrbisAppContentAppParamId;
|
||||
|
||||
int PS4_SYSV_ABI _Z5dummyv();
|
||||
int PS4_SYSV_ABI sceAppContentAddcontDelete();
|
||||
int PS4_SYSV_ABI sceAppContentAddcontEnqueueDownload();
|
||||
|
@ -35,7 +54,7 @@ int PS4_SYSV_ABI sceAppContentAddcontEnqueueDownloadSp();
|
|||
int PS4_SYSV_ABI sceAppContentAddcontMount();
|
||||
int PS4_SYSV_ABI sceAppContentAddcontShrink();
|
||||
int PS4_SYSV_ABI sceAppContentAddcontUnmount();
|
||||
int PS4_SYSV_ABI sceAppContentAppParamGetInt();
|
||||
int PS4_SYSV_ABI sceAppContentAppParamGetInt(OrbisAppContentAppParamId paramId, s32* value);
|
||||
int PS4_SYSV_ABI sceAppContentAppParamGetString();
|
||||
int PS4_SYSV_ABI sceAppContentDownload0Expand();
|
||||
int PS4_SYSV_ABI sceAppContentDownload0Shrink();
|
||||
|
@ -56,10 +75,11 @@ int PS4_SYSV_ABI sceAppContentSmallSharedDataGetAvailableSpaceKb();
|
|||
int PS4_SYSV_ABI sceAppContentSmallSharedDataMount();
|
||||
int PS4_SYSV_ABI sceAppContentSmallSharedDataUnmount();
|
||||
int PS4_SYSV_ABI sceAppContentTemporaryDataFormat();
|
||||
int PS4_SYSV_ABI sceAppContentTemporaryDataGetAvailableSpaceKb();
|
||||
int PS4_SYSV_ABI sceAppContentTemporaryDataGetAvailableSpaceKb(
|
||||
const OrbisAppContentMountPoint* mountPoint, size_t* availableSpaceKb);
|
||||
int PS4_SYSV_ABI sceAppContentTemporaryDataMount();
|
||||
int PS4_SYSV_ABI sceAppContentTemporaryDataMount2(OrbisAppContentTemporaryDataOption option,
|
||||
OrbisAppContentMountPoint* mountPoint);
|
||||
OrbisAppContentMountPoint* mountPoint);
|
||||
int PS4_SYSV_ABI sceAppContentTemporaryDataUnmount();
|
||||
int PS4_SYSV_ABI sceAppContentGetPftFlag();
|
||||
int PS4_SYSV_ABI Func_C59A36FF8D7C59DA();
|
||||
|
|
|
@ -11,52 +11,63 @@ 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.
|
||||
|
||||
int PS4_SYSV_ABI sceDbgPlayGoRequestNextChunk() {
|
||||
s32 PS4_SYSV_ABI sceDbgPlayGoRequestNextChunk() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceDbgPlayGoSnapshot() {
|
||||
s32 PS4_SYSV_ABI sceDbgPlayGoSnapshot() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoClose() {
|
||||
s32 PS4_SYSV_ABI scePlayGoClose() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoGetChunkId() {
|
||||
s32 PS4_SYSV_ABI scePlayGoGetChunkId() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoGetEta() {
|
||||
s32 PS4_SYSV_ABI scePlayGoGetEta() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoGetInstallSpeed() {
|
||||
s32 PS4_SYSV_ABI scePlayGoGetInstallSpeed() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoGetLanguageMask() {
|
||||
s32 PS4_SYSV_ABI scePlayGoGetLanguageMask(OrbisPlayGoHandle handle,
|
||||
OrbisPlayGoLanguageMask* languageMask) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
*languageMask = 1; // En, todo;
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoGetLocus() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
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;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoGetProgress() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
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;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoGetToDoList(OrbisPlayGoHandle handle, OrbisPlayGoToDo* outTodoList,
|
||||
s32 PS4_SYSV_ABI scePlayGoGetToDoList(OrbisPlayGoHandle handle, OrbisPlayGoToDo* outTodoList,
|
||||
u32 numberOfEntries, u32* outEntries) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
if (handle != shadMagic)
|
||||
|
@ -67,7 +78,7 @@ int PS4_SYSV_ABI scePlayGoGetToDoList(OrbisPlayGoHandle handle, OrbisPlayGoToDo*
|
|||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoInitialize(OrbisPlayGoInitParams* param) {
|
||||
s32 PS4_SYSV_ABI scePlayGoInitialize(OrbisPlayGoInitParams* param) {
|
||||
if (param->bufAddr == nullptr)
|
||||
return ORBIS_PLAYGO_ERROR_BAD_POINTER;
|
||||
if (param->bufSize < 0x200000)
|
||||
|
@ -76,33 +87,35 @@ int PS4_SYSV_ABI scePlayGoInitialize(OrbisPlayGoInitParams* param) {
|
|||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoOpen(OrbisPlayGoHandle* outHandle, const void* param) {
|
||||
s32 PS4_SYSV_ABI scePlayGoOpen(OrbisPlayGoHandle* outHandle, const void* param) {
|
||||
*outHandle = shadMagic;
|
||||
LOG_INFO(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoPrefetch() {
|
||||
s32 PS4_SYSV_ABI scePlayGoPrefetch() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoSetInstallSpeed() {
|
||||
s32 PS4_SYSV_ABI scePlayGoSetInstallSpeed() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoSetLanguageMask() {
|
||||
s32 PS4_SYSV_ABI scePlayGoSetLanguageMask(OrbisPlayGoHandle handle,
|
||||
OrbisPlayGoLanguageMask languageMask) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoSetToDoList() {
|
||||
s32 PS4_SYSV_ABI scePlayGoSetToDoList(OrbisPlayGoHandle handle, const OrbisPlayGoToDo* todoList,
|
||||
uint32_t numberOfEntries) {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePlayGoTerminate() {
|
||||
s32 PS4_SYSV_ABI scePlayGoTerminate() {
|
||||
LOG_ERROR(Lib_PlayGo, "(STUBBED)called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
|
|
@ -12,24 +12,29 @@ class SymbolsResolver;
|
|||
namespace Libraries::PlayGo {
|
||||
constexpr int shadMagic = 0x53484144;
|
||||
|
||||
int PS4_SYSV_ABI sceDbgPlayGoRequestNextChunk();
|
||||
int PS4_SYSV_ABI sceDbgPlayGoSnapshot();
|
||||
int PS4_SYSV_ABI scePlayGoClose();
|
||||
int PS4_SYSV_ABI scePlayGoGetChunkId();
|
||||
int PS4_SYSV_ABI scePlayGoGetEta();
|
||||
int PS4_SYSV_ABI scePlayGoGetInstallSpeed();
|
||||
int PS4_SYSV_ABI scePlayGoGetLanguageMask();
|
||||
int PS4_SYSV_ABI scePlayGoGetLocus();
|
||||
int PS4_SYSV_ABI scePlayGoGetProgress();
|
||||
int PS4_SYSV_ABI scePlayGoGetToDoList(OrbisPlayGoHandle handle, OrbisPlayGoToDo* outTodoList,
|
||||
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);
|
||||
int PS4_SYSV_ABI scePlayGoInitialize(OrbisPlayGoInitParams* param);
|
||||
int PS4_SYSV_ABI scePlayGoOpen(OrbisPlayGoHandle* outHandle, const void* param);
|
||||
int PS4_SYSV_ABI scePlayGoPrefetch();
|
||||
int PS4_SYSV_ABI scePlayGoSetInstallSpeed();
|
||||
int PS4_SYSV_ABI scePlayGoSetLanguageMask();
|
||||
int PS4_SYSV_ABI scePlayGoSetToDoList();
|
||||
int PS4_SYSV_ABI scePlayGoTerminate();
|
||||
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
|
|
@ -24,6 +24,23 @@ typedef struct OrbisPlayGoToDo {
|
|||
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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue