mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-28 01:08:24 +00:00
system_service: Add simple event queue and push an EntitlementUpdate event to it when app content is initialized (#2238)
This commit is contained in:
parent
e433f3116d
commit
564dbc7b94
|
@ -12,6 +12,7 @@
|
|||
#include "core/file_sys/fs.h"
|
||||
#include "core/libraries/app_content/app_content_error.h"
|
||||
#include "core/libraries/libs.h"
|
||||
#include "core/libraries/system/systemservice.h"
|
||||
|
||||
namespace Libraries::AppContent {
|
||||
|
||||
|
@ -262,6 +263,15 @@ int PS4_SYSV_ABI sceAppContentInitialize(const OrbisAppContentInitParam* initPar
|
|||
entitlement_label.copy(info.entitlement_label, sizeof(info.entitlement_label));
|
||||
}
|
||||
}
|
||||
|
||||
if (addcont_count > 0) {
|
||||
SystemService::OrbisSystemServiceEvent event{};
|
||||
event.event_type = SystemService::OrbisSystemServiceEventType::EntitlementUpdate;
|
||||
event.service_entitlement_update.user_id = 0;
|
||||
event.service_entitlement_update.np_service_label = 0;
|
||||
SystemService::PushSystemServiceEvent(event);
|
||||
}
|
||||
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
namespace Libraries::SystemService {
|
||||
|
||||
bool g_splash_status{true};
|
||||
std::queue<OrbisSystemServiceEvent> g_event_queue;
|
||||
std::mutex g_event_queue_mutex;
|
||||
|
||||
bool IsSplashVisible() {
|
||||
return Config::showSplash() && g_splash_status;
|
||||
|
@ -1772,7 +1774,9 @@ s32 PS4_SYSV_ABI sceSystemServiceGetStatus(OrbisSystemServiceStatus* status) {
|
|||
LOG_ERROR(Lib_SystemService, "OrbisSystemServiceStatus is null");
|
||||
return ORBIS_SYSTEM_SERVICE_ERROR_PARAMETER;
|
||||
}
|
||||
status->event_num = 0;
|
||||
|
||||
std::lock_guard<std::mutex> lock(g_event_queue_mutex);
|
||||
status->event_num = static_cast<s32>(g_event_queue.size());
|
||||
status->is_system_ui_overlaid = false;
|
||||
status->is_in_background_execution = false;
|
||||
status->is_cpu_mode7_cpu_normal = true;
|
||||
|
@ -1940,11 +1944,19 @@ int PS4_SYSV_ABI sceSystemServiceRaiseExceptionLocalProcess() {
|
|||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceSystemServiceReceiveEvent(OrbisSystemServiceEvent* event) {
|
||||
LOG_ERROR(Lib_SystemService, "(STUBBED) called");
|
||||
LOG_TRACE(Lib_SystemService, "called");
|
||||
if (event == nullptr) {
|
||||
return ORBIS_SYSTEM_SERVICE_ERROR_PARAMETER;
|
||||
}
|
||||
return ORBIS_SYSTEM_SERVICE_ERROR_NO_EVENT;
|
||||
|
||||
std::lock_guard<std::mutex> lock(g_event_queue_mutex);
|
||||
if (g_event_queue.empty()) {
|
||||
return ORBIS_SYSTEM_SERVICE_ERROR_NO_EVENT;
|
||||
}
|
||||
|
||||
*event = g_event_queue.front();
|
||||
g_event_queue.pop();
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceSystemServiceReenableMusicPlayer() {
|
||||
|
@ -2412,6 +2424,11 @@ int PS4_SYSV_ABI Func_CB5E885E225F69F0() {
|
|||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
void PushSystemServiceEvent(const OrbisSystemServiceEvent& event) {
|
||||
std::lock_guard<std::mutex> lock(g_event_queue_mutex);
|
||||
g_event_queue.push(event);
|
||||
}
|
||||
|
||||
void RegisterlibSceSystemService(Core::Loader::SymbolsResolver* sym) {
|
||||
LIB_FUNCTION("alZfRdr2RP8", "libSceAppMessaging", 1, "libSceSystemService", 1, 1,
|
||||
sceAppMessagingClearEventFlag);
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
// https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/blob/master/include/orbis/_types/sys_service.h
|
||||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include "common/types.h"
|
||||
|
||||
namespace Core::Loader {
|
||||
|
@ -603,5 +605,7 @@ int PS4_SYSV_ABI sceSystemServiceReenableVoiceRecognition();
|
|||
int PS4_SYSV_ABI Func_6B1CDB955F0EBD65();
|
||||
int PS4_SYSV_ABI Func_CB5E885E225F69F0();
|
||||
|
||||
void PushSystemServiceEvent(const OrbisSystemServiceEvent& event);
|
||||
|
||||
void RegisterlibSceSystemService(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::SystemService
|
||||
|
|
Loading…
Reference in a new issue