mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-31 23:19:44 +08:00
[VideoOut] Initialize output options storage (#315)
* [VideoOut] Initialize output options storage * [VideoOut] Keep output options size local
This commit is contained in:
@@ -381,7 +381,18 @@ public static class VideoOutExports
|
||||
LibraryName = "libSceVideoOut")]
|
||||
public static int VideoOutInitializeOutputOptions(CpuContext ctx)
|
||||
{
|
||||
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
|
||||
const int outputOptionsSize = 0x40;
|
||||
var optionsAddress = ctx[CpuRegister.Rdi];
|
||||
if (optionsAddress == 0)
|
||||
{
|
||||
return OrbisVideoOutErrorInvalidAddress;
|
||||
}
|
||||
|
||||
Span<byte> options = stackalloc byte[outputOptionsSize];
|
||||
options.Clear();
|
||||
return ctx.Memory.TryWrite(optionsAddress, options)
|
||||
? (int)OrbisGen2Result.ORBIS_GEN2_OK
|
||||
: (int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT;
|
||||
}
|
||||
|
||||
[SysAbiExport(
|
||||
|
||||
Reference in New Issue
Block a user