mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-26 04:39:17 +08:00
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
// Copyright (C) 2026 SharpEmu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
using System.Threading;
|
|
using SharpEmu.HLE;
|
|
|
|
namespace SharpEmu.Libs.CommonDialog;
|
|
|
|
public static class CommonDialogExports
|
|
{
|
|
private const int AlreadySystemInitialized = unchecked((int)0x80B80002);
|
|
private static int _initialized;
|
|
|
|
[SysAbiExport(
|
|
Nid = "uoUpLGNkygk",
|
|
ExportName = "sceCommonDialogInitialize",
|
|
Target = Generation.Gen4 | Generation.Gen5,
|
|
LibraryName = "libSceCommonDialog")]
|
|
public static int CommonDialogInitialize(CpuContext ctx)
|
|
{
|
|
var result = Interlocked.Exchange(ref _initialized, 1) == 0
|
|
? 0
|
|
: AlreadySystemInitialized;
|
|
ctx[CpuRegister.Rax] = unchecked((ulong)result);
|
|
return result;
|
|
}
|
|
|
|
[SysAbiExport(
|
|
Nid = "BQ3tey0JmQM",
|
|
ExportName = "sceCommonDialogIsUsed",
|
|
Target = Generation.Gen4 | Generation.Gen5,
|
|
LibraryName = "libSceCommonDialog")]
|
|
public static int CommonDialogIsUsed(CpuContext ctx)
|
|
{
|
|
ctx[CpuRegister.Rax] = 0;
|
|
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
|
}
|
|
}
|