Initial libSceSharePlay.

This commit is contained in:
Tyler Jaacks 2024-03-30 00:12:37 -05:00
parent afa990e5ab
commit a8f75bae2c
4 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.24)
include(../setupModule.cmake)
set(libName libSceSharePlay)
project(${libName})
add_library(${libName} SHARED entry.cpp)
setupModule(${libName})

View File

@ -0,0 +1,10 @@
#pragma once
#include <stdint.h>
namespace Err {
constexpr int SCE_SHARE_PLAY_ERROR_INVALID_ARGS = -2129788927; /* 0x810E0001 */
constexpr int SCE_SHARE_PLAY_ERROR_OUT_OF_MEMORY = -2129788926; /* 0x810E0002 */
constexpr int SCE_SHARE_PLAY_ERROR_ALREADY_INITIALIZED = -2129788925; /* 0x810E0003 */
constexpr int SCE_SHARE_PLAY_ERROR_NOT_INITIALIZED = -2129788924; /* 0x810E0004 */
constexpr int SCE_SHARE_PLAY_ERROR_FATAL = -2129788923; /* 0x810E0005 */
} // namespace Err

View File

@ -0,0 +1,48 @@
#include "common.h"
#include "logging.h"
#include "types.h"
LOG_DEFINE_MODULE(libSceSharePlay);
namespace {} // namespace
extern "C" {
EXPORT const char* MODULE_NAME = "libSceSharePlay";
EXPORT SYSV_ABI int32_t sceSharePlayInitialize(void* pHeap, size_t heapSize) {
LOG_USE_MODULE(libSceSharePlay);
LOG_INFO(L"pHeap:0x%08llx heapSize:0x%08x", (uint64_t)pHeap, heapSize);
LOG_ERR(L"TODO: %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceSharePlayTerminate() {
LOG_USE_MODULE(libSceSharePlay);
LOG_ERR(L"TODO: %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceSharePlaySetProhibition(SceSharePlayProhibitionMode mode) {
LOG_USE_MODULE(libSceSharePlay);
LOG_ERR(L"TODO: %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceSharePlayGetCurrentConnectionInfoA(SceSharePlayConnectionInfoA* pInfo) {
LOG_USE_MODULE(libSceSharePlay);
// *pInfo = {};
LOG_ERR(L"TODO: %S", __FUNCTION__);
return Ok;
}
}

View File

@ -0,0 +1,32 @@
#pragma once
#include "codes.h"
#include "modules/libSceNpManager/types.h"
enum class SceSharePlayProhibitionMode : unsigned int {
SCE_SHARE_PLAY_PROHIBITION_MODE_OFF = 0,
SCE_SHARE_PLAY_PROHIBITION_MODE_CONTROL_ONLY = 1,
SCE_SHARE_PLAY_PROHIBITION_MODE_CONTROL_SCREEN = 2
}
enum class SceSharePlayConnectionStatus : unsigned int {
SCE_SHARE_PLAY_CONNECTION_STATUS_DORMANT = 0,
SCE_SHARE_PLAY_CONNECTION_STATUS_READY = 1,
SCE_SHARE_PLAY_CONNECTION_STATUS_CONNECTED = 2,
}
enum class SceSharePlayControllerMode : unsigned int {
SCE_SHARE_PLAY_CONTROLLER_MODE_WATCHING_HOST_PLAY = 0,
SCE_SHARE_PLAY_CONTROLLER_MODE_PLAYING_AS_HOST = 1,
SCE_SHARE_PLAY_CONTROLLER_MODE_PLAYING_GAME_WITH_HOST = 2,
}
struct SceSharePlayConnectionInfoA {
SceSharePlayConnectionStatus status;
SceSharePlayControllerMode mode;
SceNpOnlineId hostOnelineId;
SceNpOnlineId visitorOnlineId;
SceNpAccountId hostAccountId;
SceNpAccountId visitorAccountId;
SceUserServiceUserId hostUserId;
SceUserServiceUserId visitorUserId;
}