Rename Ryujinx.Core to Ryujinx.HLE and add a separate project for a future LLE implementation
This commit is contained in:
parent
518fe799da
commit
76f3b1b3a4
248 changed files with 2266 additions and 2244 deletions
84
Ryujinx.HLE/OsHle/SystemStateMgr.cs
Normal file
84
Ryujinx.HLE/OsHle/SystemStateMgr.cs
Normal file
|
@ -0,0 +1,84 @@
|
|||
using System;
|
||||
|
||||
namespace Ryujinx.HLE.OsHle
|
||||
{
|
||||
public class SystemStateMgr
|
||||
{
|
||||
internal static string[] LanguageCodes = new string[]
|
||||
{
|
||||
"ja",
|
||||
"en-US",
|
||||
"fr",
|
||||
"de",
|
||||
"it",
|
||||
"es",
|
||||
"zh-CN",
|
||||
"ko",
|
||||
"nl",
|
||||
"pt",
|
||||
"ru",
|
||||
"zh-TW",
|
||||
"en-GB",
|
||||
"fr-CA",
|
||||
"es-419",
|
||||
"zh-Hans",
|
||||
"zh-Hant"
|
||||
};
|
||||
|
||||
internal static string[] AudioOutputs = new string[]
|
||||
{
|
||||
"AudioTvOutput",
|
||||
"AudioStereoJackOutput",
|
||||
"AudioBuiltInSpeakerOutput"
|
||||
};
|
||||
|
||||
internal long DesiredLanguageCode { get; private set; }
|
||||
|
||||
internal string ActiveAudioOutput { get; private set; }
|
||||
|
||||
public SystemStateMgr()
|
||||
{
|
||||
SetLanguage(SystemLanguage.AmericanEnglish);
|
||||
|
||||
SetAudioOutputAsBuiltInSpeaker();
|
||||
}
|
||||
|
||||
public void SetLanguage(SystemLanguage Language)
|
||||
{
|
||||
DesiredLanguageCode = GetLanguageCode((int)Language);
|
||||
}
|
||||
|
||||
public void SetAudioOutputAsTv()
|
||||
{
|
||||
ActiveAudioOutput = AudioOutputs[0];
|
||||
}
|
||||
|
||||
public void SetAudioOutputAsStereoJack()
|
||||
{
|
||||
ActiveAudioOutput = AudioOutputs[1];
|
||||
}
|
||||
|
||||
public void SetAudioOutputAsBuiltInSpeaker()
|
||||
{
|
||||
ActiveAudioOutput = AudioOutputs[2];
|
||||
}
|
||||
|
||||
internal static long GetLanguageCode(int Index)
|
||||
{
|
||||
if ((uint)Index >= LanguageCodes.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(Index));
|
||||
}
|
||||
|
||||
long Code = 0;
|
||||
int Shift = 0;
|
||||
|
||||
foreach (char Chr in LanguageCodes[Index])
|
||||
{
|
||||
Code |= (long)(byte)Chr << Shift++ * 8;
|
||||
}
|
||||
|
||||
return Code;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue