From 873f473b65d3d9947f3e0c966ce1ea52e1482e18 Mon Sep 17 00:00:00 2001 From: ParantezTech Date: Mon, 29 Jun 2026 13:32:17 +0300 Subject: [PATCH] [video] hide splash --- .../SystemService/SystemServiceExports.cs | 12 ++++++ .../VideoOut/VulkanVideoPresenter.cs | 40 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/SharpEmu.Libs/SystemService/SystemServiceExports.cs b/src/SharpEmu.Libs/SystemService/SystemServiceExports.cs index d602e79..27537b2 100644 --- a/src/SharpEmu.Libs/SystemService/SystemServiceExports.cs +++ b/src/SharpEmu.Libs/SystemService/SystemServiceExports.cs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later using SharpEmu.HLE; +using SharpEmu.Libs.VideoOut; using System.Buffers.Binary; namespace SharpEmu.Libs.SystemService; @@ -85,6 +86,17 @@ public static class SystemServiceExports : SetReturn(ctx, (int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT); } + [SysAbiExport( + Nid = "Vo5V8KAwCmk", + ExportName = "sceSystemServiceHideSplashScreen", + Target = Generation.Gen4 | Generation.Gen5, + LibraryName = "libSceSystemService")] + public static int SystemServiceHideSplashScreen(CpuContext ctx) + { + VulkanVideoPresenter.HideSplashScreen(); + return SetReturn(ctx, 0); + } + private static int SetReturn(CpuContext ctx, int result) { ctx[CpuRegister.Rax] = unchecked((ulong)result); diff --git a/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs b/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs index 4b9d13c..5d1fac1 100644 --- a/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs +++ b/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs @@ -88,6 +88,28 @@ internal static unsafe class VulkanVideoPresenter } } + public static void HideSplashScreen() + { + lock (_gate) + { + _splashHidden = true; + if (_closed || _latestPresentation is not { IsSplash: true } latest) + { + return; + } + + var sequence = latest.Sequence + 1; + _latestPresentation = new Presentation( + CreateBlackFrame(latest.Width, latest.Height), + latest.Width, + latest.Height, + sequence, + GuestDrawKind.None, + IsSplash: false); + Console.Error.WriteLine("[LOADER][INFO] Vulkan VideoOut hid splash"); + } + } + public static void Submit(byte[] bgraFrame, uint width, uint height) { if (bgraFrame.Length != checked((int)(width * height * 4))) @@ -168,6 +190,24 @@ internal static unsafe class VulkanVideoPresenter } } + private static byte[] CreateBlackFrame(uint width, uint height) + { + if (width == 0 || height == 0 || width > 8192 || height > 8192) + { + width = 1; + height = 1; + } + + var pixels = GC.AllocateUninitializedArray(checked((int)(width * height * 4))); + pixels.AsSpan().Clear(); + for (var offset = 3; offset < pixels.Length; offset += 4) + { + pixels[offset] = 0xFF; + } + + return pixels; + } + private static void Run() { uint width;