mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-30 22:49:53 +08:00
fix(remoteplay): stub Initialize and GetConnectionStatus as disconnected (#536)
* fix(remoteplay): stub Initialize and GetConnectionStatus as disconnected Titles probe Remote Play during pad/network bring-up; unresolved imports returned NOT_FOUND. Report initialized + disconnected so callers take the normal offline path. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: retrigger gameplay CI for PR #536 Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
// Copyright (C) 2026 SharpEmu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
using SharpEmu.HLE;
|
||||
|
||||
namespace SharpEmu.Libs.Remoteplay;
|
||||
|
||||
// SharpEmu does not implement PS5 Remote Play. Titles still probe this API
|
||||
// during startup (initialize + connection-status checks while bringing up
|
||||
// pad/network subsystems). Without a handler they get ORBIS_GEN2_ERROR_NOT_FOUND
|
||||
// instead of a real status code. Reporting a clean "initialized, not connected"
|
||||
// state lets callers take their normal no-remote-play path.
|
||||
public static class RemoteplayExports
|
||||
{
|
||||
private const int StatusDisconnected = 0;
|
||||
|
||||
[SysAbiExport(
|
||||
Nid = "k1SwgkMSOM8",
|
||||
ExportName = "sceRemoteplayInitialize",
|
||||
Target = Generation.Gen5,
|
||||
LibraryName = "libSceRemoteplay")]
|
||||
public static int RemoteplayInitialize(CpuContext ctx) => SetReturn(ctx, 0);
|
||||
|
||||
[SysAbiExport(
|
||||
Nid = "g3PNjYKWqnQ",
|
||||
ExportName = "sceRemoteplayGetConnectionStatus",
|
||||
Target = Generation.Gen5,
|
||||
LibraryName = "libSceRemoteplay")]
|
||||
public static int RemoteplayGetConnectionStatus(CpuContext ctx)
|
||||
{
|
||||
var statusAddress = ctx[CpuRegister.Rsi];
|
||||
if (statusAddress != 0)
|
||||
{
|
||||
Span<byte> status = stackalloc byte[0x10];
|
||||
status.Clear();
|
||||
status[0] = StatusDisconnected;
|
||||
if (!ctx.Memory.TryWrite(statusAddress, status))
|
||||
{
|
||||
return SetReturn(ctx, (int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT);
|
||||
}
|
||||
}
|
||||
|
||||
return SetReturn(ctx, 0);
|
||||
}
|
||||
|
||||
private static int SetReturn(CpuContext ctx, int result)
|
||||
{
|
||||
ctx[CpuRegister.Rax] = unchecked((ulong)result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user