public static void Read(Switch Device) { string IniFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string IniPath = Path.Combine(IniFolder, "Ryujinx.conf"); IniParser Parser = new IniParser(IniPath); GraphicsConfig.ShadersDumpPath = Parser.Value("Graphics_Shaders_Dump_Path"); Device.Log.SetEnable(LogLevel.Debug, Convert.ToBoolean(Parser.Value("Logging_Enable_Debug"))); Device.Log.SetEnable(LogLevel.Stub, Convert.ToBoolean(Parser.Value("Logging_Enable_Stub"))); Device.Log.SetEnable(LogLevel.Info, Convert.ToBoolean(Parser.Value("Logging_Enable_Info"))); Device.Log.SetEnable(LogLevel.Warning, Convert.ToBoolean(Parser.Value("Logging_Enable_Warn"))); Device.Log.SetEnable(LogLevel.Error, Convert.ToBoolean(Parser.Value("Logging_Enable_Error"))); string[] FilteredLogClasses = Parser.Value("Logging_Filtered_Classes").Split(',', StringSplitOptions.RemoveEmptyEntries); //When the classes are specified on the list, we only //enable the classes that are on the list. //So, first disable everything, then enable //the classes that the user added to the list. if (FilteredLogClasses.Length > 0) { foreach (LogClass Class in Enum.GetValues(typeof(LogClass))) { Device.Log.SetEnable(Class, false); } } foreach (string LogClass in FilteredLogClasses) { if (!string.IsNullOrEmpty(LogClass.Trim())) { foreach (LogClass Class in Enum.GetValues(typeof(LogClass))) { if (Class.ToString().ToLower().Contains(LogClass.Trim().ToLower())) { Device.Log.SetEnable(Class, true); } } } } Device.System.State.DockedMode = Convert.ToBoolean(Parser.Value("Docked_Mode")); Device.EnableDeviceVsync = Convert.ToBoolean(Parser.Value("Enable_Vsync")); if (Convert.ToBoolean(Parser.Value("Enable_MultiCore_Scheduling"))) { Device.System.EnableMultiCoreScheduling(); } JoyConKeyboard = new JoyConKeyboard( new JoyConKeyboardLeft { StickUp = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Up")), StickDown = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Down")), StickLeft = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Left")), StickRight = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Right")), StickButton = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Button")), DPadUp = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_DPad_Up")), DPadDown = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_DPad_Down")), DPadLeft = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_DPad_Left")), DPadRight = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_DPad_Right")), ButtonMinus = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Button_Minus")), ButtonL = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Button_L")), ButtonZL = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Button_ZL")) }, new JoyConKeyboardRight { StickUp = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Up")), StickDown = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Down")), StickLeft = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Left")), StickRight = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Right")), StickButton = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Button")), ButtonA = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_A")), ButtonB = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_B")), ButtonX = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_X")), ButtonY = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_Y")), ButtonPlus = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_Plus")), ButtonR = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_R")), ButtonZR = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_ZR")) }); JoyConController = new JoyConController( Convert.ToBoolean(Parser.Value("GamePad_Enable")), Convert.ToInt32(Parser.Value("GamePad_Index")), (float)Convert.ToDouble(Parser.Value("GamePad_Deadzone"), CultureInfo.InvariantCulture), (float)Convert.ToDouble(Parser.Value("GamePad_Trigger_Threshold"), CultureInfo.InvariantCulture), new JoyConControllerLeft { Stick = ToID(Parser.Value("Controls_Left_JoyConController_Stick")), StickButton = ToID(Parser.Value("Controls_Left_JoyConController_Stick_Button")), DPadUp = ToID(Parser.Value("Controls_Left_JoyConController_DPad_Up")), DPadDown = ToID(Parser.Value("Controls_Left_JoyConController_DPad_Down")), DPadLeft = ToID(Parser.Value("Controls_Left_JoyConController_DPad_Left")), DPadRight = ToID(Parser.Value("Controls_Left_JoyConController_DPad_Right")), ButtonMinus = ToID(Parser.Value("Controls_Left_JoyConController_Button_Minus")), ButtonL = ToID(Parser.Value("Controls_Left_JoyConController_Button_L")), ButtonZL = ToID(Parser.Value("Controls_Left_JoyConController_Button_ZL")) }, new JoyConControllerRight { Stick = ToID(Parser.Value("Controls_Right_JoyConController_Stick")), StickButton = ToID(Parser.Value("Controls_Right_JoyConController_Stick_Button")), ButtonA = ToID(Parser.Value("Controls_Right_JoyConController_Button_A")), ButtonB = ToID(Parser.Value("Controls_Right_JoyConController_Button_B")), ButtonX = ToID(Parser.Value("Controls_Right_JoyConController_Button_X")), ButtonY = ToID(Parser.Value("Controls_Right_JoyConController_Button_Y")), ButtonPlus = ToID(Parser.Value("Controls_Right_JoyConController_Button_Plus")), ButtonR = ToID(Parser.Value("Controls_Right_JoyConController_Button_R")), ButtonZR = ToID(Parser.Value("Controls_Right_JoyConController_Button_ZR")) }); }
public static void Read(Logger Log) { string IniFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string IniPath = Path.Combine(IniFolder, "Ryujinx.conf"); IniParser Parser = new IniParser(IniPath); AOptimizations.DisableMemoryChecks = !Convert.ToBoolean(Parser.Value("Enable_Memory_Checks")); Log.SetEnable(LogLevel.Debug, Convert.ToBoolean(Parser.Value("Logging_Enable_Debug"))); Log.SetEnable(LogLevel.Stub, Convert.ToBoolean(Parser.Value("Logging_Enable_Stub"))); Log.SetEnable(LogLevel.Info, Convert.ToBoolean(Parser.Value("Logging_Enable_Info"))); Log.SetEnable(LogLevel.Warning, Convert.ToBoolean(Parser.Value("Logging_Enable_Warn"))); Log.SetEnable(LogLevel.Error, Convert.ToBoolean(Parser.Value("Logging_Enable_Error"))); GamePadEnable = Convert.ToBoolean(Parser.Value("GamePad_Enable")); GamePadIndex = Convert.ToInt32(Parser.Value("GamePad_Index")); GamePadDeadzone = (float)Convert.ToDouble(Parser.Value("GamePad_Deadzone"), CultureInfo.InvariantCulture); GamePadTriggerThreshold = (float)Convert.ToDouble(Parser.Value("GamePad_Trigger_Threshold"), CultureInfo.InvariantCulture); string[] FilteredLogClasses = Parser.Value("Logging_Filtered_Classes").Split(',', StringSplitOptions.RemoveEmptyEntries); //When the classes are specified on the list, we only //enable the classes that are on the list. //So, first disable everything, then enable //the classes that the user added to the list. if (FilteredLogClasses.Length > 0) { foreach (LogClass Class in Enum.GetValues(typeof(LogClass))) { Log.SetEnable(Class, false); } } foreach (string LogClass in FilteredLogClasses) { if (!string.IsNullOrEmpty(LogClass.Trim())) { foreach (LogClass Class in Enum.GetValues(typeof(LogClass))) { if (Class.ToString().ToLower().Contains(LogClass.Trim().ToLower())) { Log.SetEnable(Class, true); } } } } JoyConKeyboard = new JoyConKeyboard { Left = new JoyConKeyboardLeft { StickUp = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Up")), StickDown = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Down")), StickLeft = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Left")), StickRight = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Right")), StickButton = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Stick_Button")), DPadUp = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_DPad_Up")), DPadDown = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_DPad_Down")), DPadLeft = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_DPad_Left")), DPadRight = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_DPad_Right")), ButtonMinus = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Button_Minus")), ButtonL = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Button_L")), ButtonZL = Convert.ToInt16(Parser.Value("Controls_Left_JoyConKeyboard_Button_ZL")) }, Right = new JoyConKeyboardRight { StickUp = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Up")), StickDown = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Down")), StickLeft = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Left")), StickRight = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Right")), StickButton = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Stick_Button")), ButtonA = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_A")), ButtonB = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_B")), ButtonX = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_X")), ButtonY = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_Y")), ButtonPlus = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_Plus")), ButtonR = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_R")), ButtonZR = Convert.ToInt16(Parser.Value("Controls_Right_JoyConKeyboard_Button_ZR")) } }; JoyConController = new JoyConController { Left = new JoyConControllerLeft { Stick = Parser.Value("Controls_Left_JoyConController_Stick"), StickButton = Parser.Value("Controls_Left_JoyConController_Stick_Button"), DPadUp = Parser.Value("Controls_Left_JoyConController_DPad_Up"), DPadDown = Parser.Value("Controls_Left_JoyConController_DPad_Down"), DPadLeft = Parser.Value("Controls_Left_JoyConController_DPad_Left"), DPadRight = Parser.Value("Controls_Left_JoyConController_DPad_Right"), ButtonMinus = Parser.Value("Controls_Left_JoyConController_Button_Minus"), ButtonL = Parser.Value("Controls_Left_JoyConController_Button_L"), ButtonZL = Parser.Value("Controls_Left_JoyConController_Button_ZL") }, Right = new JoyConControllerRight { Stick = Parser.Value("Controls_Right_JoyConController_Stick"), StickButton = Parser.Value("Controls_Right_JoyConController_Stick_Button"), ButtonA = Parser.Value("Controls_Right_JoyConController_Button_A"), ButtonB = Parser.Value("Controls_Right_JoyConController_Button_B"), ButtonX = Parser.Value("Controls_Right_JoyConController_Button_X"), ButtonY = Parser.Value("Controls_Right_JoyConController_Button_Y"), ButtonPlus = Parser.Value("Controls_Right_JoyConController_Button_Plus"), ButtonR = Parser.Value("Controls_Right_JoyConController_Button_R"), ButtonZR = Parser.Value("Controls_Right_JoyConController_Button_ZR") } }; }
public static void Read() { var iniFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); var iniPath = Path.Combine(iniFolder, "Ryujinx.conf"); IniParser Parser = new IniParser(iniPath); EnableMemoryChecks = Convert.ToBoolean(Parser.Value("Enable_Memory_Checks")); LoggingEnableInfo = Convert.ToBoolean(Parser.Value("Logging_Enable_Info")); LoggingEnableTrace = Convert.ToBoolean(Parser.Value("Logging_Enable_Trace")); LoggingEnableDebug = Convert.ToBoolean(Parser.Value("Logging_Enable_Debug")); LoggingEnableWarn = Convert.ToBoolean(Parser.Value("Logging_Enable_Warn")); LoggingEnableError = Convert.ToBoolean(Parser.Value("Logging_Enable_Error")); LoggingEnableFatal = Convert.ToBoolean(Parser.Value("Logging_Enable_Fatal")); LoggingEnableIpc = Convert.ToBoolean(Parser.Value("Logging_Enable_Ipc")); LoggingEnableStub = Convert.ToBoolean(Parser.Value("Logging_Enable_Stub")); LoggingEnableLogFile = Convert.ToBoolean(Parser.Value("Logging_Enable_LogFile")); LoggingEnableFilter = Convert.ToBoolean(Parser.Value("Logging_Enable_Filter")); LoggingFilteredClasses = new bool[(int)LogClass.Count]; string[] FilteredLogClasses = Parser.Value("Logging_Filtered_Classes", string.Empty).Split(','); foreach (string LogClass in FilteredLogClasses) { if (!string.IsNullOrEmpty(LogClass.Trim())) { foreach (LogClass EnumItemName in Enum.GetValues(typeof(LogClass))) { if (EnumItemName.ToString().ToLower().Contains(LogClass.Trim().ToLower())) { LoggingFilteredClasses[(int)EnumItemName] = true; } } } } FakeJoyCon = new JoyCon { Left = new JoyConLeft { StickUp = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_Stick_Up")), StickDown = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_Stick_Down")), StickLeft = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_Stick_Left")), StickRight = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_Stick_Right")), StickButton = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_Stick_Button")), DPadUp = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_DPad_Up")), DPadDown = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_DPad_Down")), DPadLeft = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_DPad_Left")), DPadRight = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_DPad_Right")), ButtonMinus = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_Button_Minus")), ButtonL = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_Button_L")), ButtonZL = Convert.ToInt16(Parser.Value("Controls_Left_FakeJoycon_Button_ZL")) }, Right = new JoyConRight { StickUp = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Stick_Up")), StickDown = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Stick_Down")), StickLeft = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Stick_Left")), StickRight = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Stick_Right")), StickButton = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Stick_Button")), ButtonA = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Button_A")), ButtonB = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Button_B")), ButtonX = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Button_X")), ButtonY = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Button_Y")), ButtonPlus = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Button_Plus")), ButtonR = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Button_R")), ButtonZR = Convert.ToInt16(Parser.Value("Controls_Right_FakeJoycon_Button_ZR")) } }; }