From c11855565e0ce2bac228610cbaa92c8c7f082c70 Mon Sep 17 00:00:00 2001 From: mageven <62494521+mageven@users.noreply.github.com> Date: Mon, 3 Aug 2020 07:00:58 +0530 Subject: Implement Software Keyboard GTK frontend (#1434) * Implement SwKbd GUI * Relocate UI handler to Emu Context from Config Also create a common interface for UI handlers in the context and specialize for Gtk Add basic input length validation in InputDialog * Add Transfer Memory support to AppletCreator Read Initial Text for SwKbd using Transfer Memory * Improve InputDialog widget Improve length validation Has extra label to show validition info Handle potential errors and log them * Misc improvements * Improve string validation * Improve error handling * Remove tuple in struct * Address formatting nits * Add proper Cancel functionality Also handle GUI errors in UI handler * Address jD's comments * Fix _uiHandler init * Address AcK's comments --- .../SystemAppletProxy/ILibraryAppletCreator.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy') diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs index 564bde09..bc0e4d8a 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs @@ -1,4 +1,5 @@ -using Ryujinx.HLE.HOS.Applets; +using Ryujinx.Common.Logging; +using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletCreator; namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy @@ -36,10 +37,21 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { bool unknown = context.RequestData.ReadBoolean(); long size = context.RequestData.ReadInt64(); + int handle = context.Request.HandleDesc.ToCopy[0]; - // NOTE: We don't support TransferMemory for now. + KTransferMemory transferMem = context.Process.HandleTable.GetObject(handle); - MakeObject(context, new IStorage(new byte[size])); + if (transferMem == null) + { + Logger.PrintWarning(LogClass.ServiceAm, $"Invalid TransferMemory Handle: {handle:X}"); + + return ResultCode.Success; // TODO: Find correct error code + } + + var data = new byte[transferMem.Size]; + context.Memory.Read(transferMem.Address, data); + + MakeObject(context, new IStorage(data)); return ResultCode.Success; } -- cgit v1.2.3