show title splash while the game is loading

This commit is contained in:
georgemoralis
2024-05-16 16:58:14 +03:00
parent 55855b4195
commit c9b5b5e963
14 changed files with 8147 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/config.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
@@ -8,6 +9,12 @@
namespace Libraries::SystemService {
bool g_splash_status{true};
bool IsSplashVisible() {
return Config::showSplash() && g_splash_status;
}
int PS4_SYSV_ABI sceAppMessagingClearEventFlag() {
LOG_ERROR(Lib_SystemService, "(STUBBED) called");
return ORBIS_OK;
@@ -1787,7 +1794,8 @@ int PS4_SYSV_ABI sceSystemServiceGetVersionNumberOfCameraCalibrationData() {
}
s32 PS4_SYSV_ABI sceSystemServiceHideSplashScreen() {
LOG_WARNING(Lib_SystemService, "called");
LOG_INFO(Lib_SystemService, "called");
g_splash_status = false;
return ORBIS_OK;
}

View File

@@ -102,6 +102,8 @@ struct OrbisSystemServiceDisplaySafeAreaInfo {
uint8_t reserved[128];
};
bool IsSplashVisible();
int PS4_SYSV_ABI sceAppMessagingClearEventFlag();
int PS4_SYSV_ABI sceAppMessagingReceiveMsg();
int PS4_SYSV_ABI sceAppMessagingSendMsg();

View File

@@ -167,6 +167,7 @@ void VideoOutDriver::Flip(std::chrono::microseconds timeout) {
std::unique_lock lock{mutex};
submit_cond.wait_for(lock, timeout, [&] { return !requests.empty(); });
if (requests.empty()) {
renderer->ShowSplash();
return;
}
@@ -175,8 +176,11 @@ void VideoOutDriver::Flip(std::chrono::microseconds timeout) {
requests.pop();
}
// Present the frame.
renderer->Present(req.frame);
if (!renderer->ShowSplash(
req.frame)) { // Whatever the game is rendering show splash if it is active
// Present the frame.
renderer->Present(req.frame);
}
std::scoped_lock lock{mutex};