diff options
| author | Ac_K <Acoustik666@gmail.com> | 2018-04-21 23:04:43 +0000 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-04-21 20:04:43 -0300 |
| commit | 4906acdde96c09b4e12a3801a4bacd5233a2f8e6 (patch) | |
| tree | f1ecba22f4c44c2b50b86904fe4f784e5e520cf1 /Ryujinx.Core/OsHle/Services/Set | |
| parent | 434e40b8a07a2a350d72581e41e313213ee25663 (diff) | |
Some implementations (#99)
* Some implementations
- ICommonStateGetter
* GetBootMode
- ISelfController
* SetHandlesRequestToDisplay
- IServiceGetterInterface
- ISystemUpdateInterface
- IVulnerabilityManagerInterface
- IPrepoService
- ISettingsServer
* GetLanguageCode
- ISystemSettingsServer
* GetFirmwareVersion2
- IHOSBinderDriver
* TransactParcelAuto
* Fix Implementations
* Fix Implementations 2
Diffstat (limited to 'Ryujinx.Core/OsHle/Services/Set')
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Set/ISettingsServer.cs | 28 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs | 56 |
2 files changed, 81 insertions, 3 deletions
diff --git a/Ryujinx.Core/OsHle/Services/Set/ISettingsServer.cs b/Ryujinx.Core/OsHle/Services/Set/ISettingsServer.cs index 9d5b4888..ea0303f0 100644 --- a/Ryujinx.Core/OsHle/Services/Set/ISettingsServer.cs +++ b/Ryujinx.Core/OsHle/Services/Set/ISettingsServer.cs @@ -1,5 +1,7 @@ using Ryujinx.Core.OsHle.Ipc; +using System; using System.Collections.Generic; +using System.IO; namespace Ryujinx.Core.OsHle.Services.Set { @@ -34,11 +36,37 @@ namespace Ryujinx.Core.OsHle.Services.Set { m_Commands = new Dictionary<int, ServiceProcessRequest>() { + { 0, GetLanguageCode }, { 1, GetAvailableLanguageCodes }, { 3, GetAvailableLanguageCodeCount } }; } + public static long GetLanguageCode(ServiceCtx Context) + { + Context.ResponseData.Write(LanguageCodetoLongBE(LanguageCodes[1])); + + return 0; + } + + private static long LanguageCodetoLongBE(string LanguageCode) + { + using (MemoryStream MS = new MemoryStream()) + { + foreach (char Chr in LanguageCode) + { + MS.WriteByte((byte)Chr); + } + + for (int Offs = 0; Offs < (8 - LanguageCode.Length); Offs++) + { + MS.WriteByte(0); + } + + return BitConverter.ToInt64(MS.ToArray(), 0); + } + } + public static long GetAvailableLanguageCodes(ServiceCtx Context) { long Position = Context.Request.RecvListBuff[0].Position; diff --git a/Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs b/Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs index 21b737a0..bdf5c7b4 100644 --- a/Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs +++ b/Ryujinx.Core/OsHle/Services/Set/ISystemSettingsServer.cs @@ -1,6 +1,9 @@ -using Ryujinx.Core.OsHle.Ipc; +using ChocolArm64.Memory; +using Ryujinx.Core.OsHle.Ipc; using Ryujinx.Core.Settings; using System.Collections.Generic; +using System.IO; +using System.Text; namespace Ryujinx.Core.OsHle.Services.Set { @@ -14,11 +17,58 @@ namespace Ryujinx.Core.OsHle.Services.Set { m_Commands = new Dictionary<int, ServiceProcessRequest>() { - { 23, GetColorSetId }, - { 24, SetColorSetId } + { 4, GetFirmwareVersion2 }, + { 23, GetColorSetId }, + { 24, SetColorSetId } }; } + public static long GetFirmwareVersion2(ServiceCtx Context) + { + long ReplyPos = Context.Request.RecvListBuff[0].Position; + long ReplySize = Context.Request.RecvListBuff[0].Size; + + byte MajorFWVersion = 0x03; + byte MinorFWVersion = 0x00; + byte MicroFWVersion = 0x00; + byte Unknown = 0x00; //Build? + + int RevisionNumber = 0x0A; + + string Platform = "NX"; + string UnknownHex = "7fbde2b0bba4d14107bf836e4643043d9f6c8e47"; + string Version = "3.0.0"; + string Build = "NintendoSDK Firmware for NX 3.0.0-10.0"; + + //http://switchbrew.org/index.php?title=System_Version_Title + using (MemoryStream MS = new MemoryStream(0x100)) + { + BinaryWriter Writer = new BinaryWriter(MS); + + Writer.Write(MajorFWVersion); + Writer.Write(MinorFWVersion); + Writer.Write(MicroFWVersion); + Writer.Write(Unknown); + + Writer.Write(RevisionNumber); + + Writer.Write(Encoding.ASCII.GetBytes(Platform)); + + MS.Seek(0x28, SeekOrigin.Begin); + Writer.Write(Encoding.ASCII.GetBytes(UnknownHex)); + + MS.Seek(0x68, SeekOrigin.Begin); + Writer.Write(Encoding.ASCII.GetBytes(Version)); + + MS.Seek(0x80, SeekOrigin.Begin); + Writer.Write(Encoding.ASCII.GetBytes(Build)); + + AMemoryHelper.WriteBytes(Context.Memory, ReplyPos, MS.ToArray()); + } + + return 0; + } + public static long GetColorSetId(ServiceCtx Context) { Context.ResponseData.Write((int)Context.Ns.Settings.ThemeColor); |
