mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-31 23:19:44 +08:00
Required imports for Astro Bot (#710)
* Required imports for Astro Bot * Add missing clone to match ValueIndexCString
This commit is contained in:
@@ -323,6 +323,37 @@ public static class JsonExports
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SysAbiExport(
|
||||||
|
Nid = "wLsJlmgEIaI",
|
||||||
|
ExportName = "_ZN3sce4Json5Value10referValueERKNS0_6StringE",
|
||||||
|
Target = Generation.Gen4 | Generation.Gen5,
|
||||||
|
LibraryName = "libSceJson")]
|
||||||
|
public static int ValueReferValue(CpuContext ctx)
|
||||||
|
{
|
||||||
|
var thisAddress = ctx[CpuRegister.Rdi];
|
||||||
|
var keyStringAddress = ctx[CpuRegister.Rsi];
|
||||||
|
|
||||||
|
if (thisAddress == 0 ||
|
||||||
|
!_strings.TryGetValue(keyStringAddress, out var keyState) ||
|
||||||
|
!TryAllocateGuestObject(ctx, ValueObjectSize, out var childAddress))
|
||||||
|
{
|
||||||
|
ctx[CpuRegister.Rax] = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var parent = GetValue(thisAddress);
|
||||||
|
|
||||||
|
var child = parent.ValueKind == System.Text.Json.JsonValueKind.Object &&
|
||||||
|
parent.TryGetProperty(keyState.Value, out var property)
|
||||||
|
? property.Clone() : _nullElement;
|
||||||
|
|
||||||
|
StoreValue(ctx, childAddress, child);
|
||||||
|
|
||||||
|
ctx[CpuRegister.Rax] = childAddress;
|
||||||
|
TraceJsonText("Value.referValue", thisAddress, keyState.Value);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
[SysAbiExport(
|
[SysAbiExport(
|
||||||
Nid = "zTwZdI8AZ5Y",
|
Nid = "zTwZdI8AZ5Y",
|
||||||
ExportName = "_ZNK3sce4Json5Value10getBooleanEv",
|
ExportName = "_ZNK3sce4Json5Value10getBooleanEv",
|
||||||
|
|||||||
@@ -3528,6 +3528,33 @@ public static partial class KernelMemoryCompatExports
|
|||||||
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SysAbiExport(
|
||||||
|
Nid = "mkgXxsoxWHg",
|
||||||
|
ExportName = "sceKernelClearVirtualRangeName",
|
||||||
|
Target = Generation.Gen4 | Generation.Gen5,
|
||||||
|
LibraryName = "libKernel")]
|
||||||
|
public static int KernelClearVirtualRangeName(CpuContext ctx)
|
||||||
|
{
|
||||||
|
var address = ctx[CpuRegister.Rdi];
|
||||||
|
var length = ctx[CpuRegister.Rsi];
|
||||||
|
|
||||||
|
lock (_memoryGate)
|
||||||
|
{
|
||||||
|
if (!TryFindVirtualQueryRegionLocked(address, findNext: false, out var region) ||
|
||||||
|
length > region.Length ||
|
||||||
|
address < region.Address ||
|
||||||
|
length > region.Address + region.Length - address)
|
||||||
|
{
|
||||||
|
return (int)OrbisGen2Result.ORBIS_GEN2_ERROR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
_mappedRegionNames.Remove(region.Address);
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx[CpuRegister.Rax] = 0;
|
||||||
|
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
||||||
|
}
|
||||||
|
|
||||||
[SysAbiExport(
|
[SysAbiExport(
|
||||||
Nid = "rVjRvHJ0X6c",
|
Nid = "rVjRvHJ0X6c",
|
||||||
ExportName = "sceKernelVirtualQuery",
|
ExportName = "sceKernelVirtualQuery",
|
||||||
|
|||||||
Reference in New Issue
Block a user