no name: Mii Editor applet support (#2419)

* no name: Mii Editor applet support

* addresses gdkchan feedback

* Fix comment

* Bypass MountCounter of MiiDatabaseManager

* Fix GetSettingsPlatformRegion

* Disable Applet Menu for unsupported firmwares
This commit is contained in:
Ac_K 2021-06-28 20:54:45 +02:00 committed by GitHub
parent fefd4619a5
commit a79b39b913
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 591 additions and 33 deletions

View file

@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletProxy
{
class AppletStandalone
{
public AppletId AppletId;
public LibraryAppletMode LibraryAppletMode;
public Queue<byte[]> InputData;
public AppletStandalone()
{
InputData = new Queue<byte[]>();
}
}
}

View file

@ -0,0 +1,78 @@
using Ryujinx.Common;
using System;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletProxy
{
class ILibraryAppletSelfAccessor : IpcService
{
private AppletStandalone _appletStandalone = new AppletStandalone();
public ILibraryAppletSelfAccessor(ServiceCtx context)
{
if (context.Device.Application.TitleId == 0x0100000000001009)
{
// Create MiiEdit data.
_appletStandalone = new AppletStandalone()
{
AppletId = AppletId.MiiEdit,
LibraryAppletMode = LibraryAppletMode.AllForeground
};
byte[] miiEditInputData = new byte[0x100];
miiEditInputData[0] = 0x03; // Hardcoded unknown value.
_appletStandalone.InputData.Enqueue(miiEditInputData);
}
else
{
throw new NotImplementedException($"{context.Device.Application.TitleId} applet is not implemented.");
}
}
[CommandHipc(0)]
// PopInData() -> object<nn::am::service::IStorage>
public ResultCode PopInData(ServiceCtx context)
{
byte[] appletData = _appletStandalone.InputData.Dequeue();
if (appletData.Length == 0)
{
return ResultCode.NotAvailable;
}
MakeObject(context, new IStorage(appletData));
return ResultCode.Success;
}
[CommandHipc(11)]
// GetLibraryAppletInfo() -> nn::am::service::LibraryAppletInfo
public ResultCode GetLibraryAppletInfo(ServiceCtx context)
{
LibraryAppletInfo libraryAppletInfo = new LibraryAppletInfo()
{
AppletId = _appletStandalone.AppletId,
LibraryAppletMode = _appletStandalone.LibraryAppletMode
};
context.ResponseData.WriteStruct(libraryAppletInfo);
return ResultCode.Success;
}
[CommandHipc(14)]
// GetCallerAppletIdentityInfo() -> nn::am::service::AppletIdentityInfo
public ResultCode GetCallerAppletIdentityInfo(ServiceCtx context)
{
AppletIdentifyInfo appletIdentifyInfo = new AppletIdentifyInfo()
{
AppletId = AppletId.QLaunch,
TitleId = 0x0100000000001000
};
context.ResponseData.WriteStruct(appletIdentifyInfo);
return ResultCode.Success;
}
}
}

View file

@ -0,0 +1,24 @@
using Ryujinx.Common;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletProxy
{
class IProcessWindingController : IpcService
{
public IProcessWindingController() { }
[CommandHipc(0)]
// GetLaunchReason() -> nn::am::service::AppletProcessLaunchReason
public ResultCode GetLaunchReason(ServiceCtx context)
{
// NOTE: Flag is set by using an internal field.
AppletProcessLaunchReason appletProcessLaunchReason = new AppletProcessLaunchReason()
{
Flag = 0
};
context.ResponseData.WriteStruct(appletProcessLaunchReason);
return ResultCode.Success;
}
}
}